2008-10-23 05:26:29 +00:00
|
|
|
#ifndef _ASM_X86_VM86_H
|
|
|
|
#define _ASM_X86_VM86_H
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-05-28 07:46:19 +00:00
|
|
|
#include <asm/ptrace.h>
|
2012-12-14 22:37:13 +00:00
|
|
|
#include <uapi/asm/vm86.h>
|
2008-05-12 13:43:38 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* This is the (kernel) stack-layout when we have done a "SAVE_ALL" from vm86
|
|
|
|
* mode - the main change is that the old segment descriptors aren't
|
|
|
|
* useful any more and are forced to be zero by the kernel (and the
|
|
|
|
* hardware when a trap occurs), and the real segment descriptors are
|
|
|
|
* at the end of the structure. Look at ptrace.h to see the "normal"
|
|
|
|
* setup. For user space layout see 'struct vm86_regs' above.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct kernel_vm86_regs {
|
|
|
|
/*
|
|
|
|
* normal regs, with special meaning for the segment descriptors..
|
|
|
|
*/
|
2006-12-07 01:14:03 +00:00
|
|
|
struct pt_regs pt;
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* these are specific to v86 mode:
|
|
|
|
*/
|
|
|
|
unsigned short es, __esh;
|
|
|
|
unsigned short ds, __dsh;
|
|
|
|
unsigned short fs, __fsh;
|
|
|
|
unsigned short gs, __gsh;
|
|
|
|
};
|
|
|
|
|
2015-07-29 05:41:16 +00:00
|
|
|
struct vm86 {
|
2015-07-29 05:41:22 +00:00
|
|
|
struct vm86plus_struct __user *user_vm86;
|
2015-07-29 05:41:19 +00:00
|
|
|
struct pt_regs regs32;
|
2015-07-29 05:41:23 +00:00
|
|
|
unsigned long veflags;
|
|
|
|
unsigned long veflags_mask;
|
2015-07-29 05:41:16 +00:00
|
|
|
unsigned long saved_sp0;
|
2015-07-29 05:41:17 +00:00
|
|
|
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long screen_bitmap;
|
|
|
|
unsigned long cpu_type;
|
|
|
|
struct revectored_struct int_revectored;
|
|
|
|
struct revectored_struct int21_revectored;
|
|
|
|
struct vm86plus_info_struct vm86plus;
|
2015-07-29 05:41:16 +00:00
|
|
|
};
|
|
|
|
|
2006-01-08 09:05:26 +00:00
|
|
|
#ifdef CONFIG_VM86
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
void handle_vm86_fault(struct kernel_vm86_regs *, long);
|
|
|
|
int handle_vm86_trap(struct kernel_vm86_regs *, long, int);
|
2015-07-29 05:41:19 +00:00
|
|
|
void save_v86_state(struct kernel_vm86_regs *, int);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-01-08 09:05:26 +00:00
|
|
|
struct task_struct;
|
|
|
|
|
2015-07-29 05:41:16 +00:00
|
|
|
#define free_vm86(t) do { \
|
|
|
|
struct thread_struct *__t = (t); \
|
|
|
|
if (__t->vm86 != NULL) { \
|
|
|
|
kfree(__t->vm86); \
|
|
|
|
__t->vm86 = NULL; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2015-07-31 08:59:20 +00:00
|
|
|
/*
|
|
|
|
* Support for VM86 programs to request interrupts for
|
|
|
|
* real mode hardware drivers:
|
|
|
|
*/
|
|
|
|
#define FIRST_VM86_IRQ 3
|
|
|
|
#define LAST_VM86_IRQ 15
|
|
|
|
|
|
|
|
static inline int invalid_vm86_irq(int irq)
|
|
|
|
{
|
|
|
|
return irq < FIRST_VM86_IRQ || irq > LAST_VM86_IRQ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void release_vm86_irqs(struct task_struct *);
|
|
|
|
|
2006-01-08 09:05:26 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
#define handle_vm86_fault(a, b)
|
|
|
|
#define release_vm86_irqs(a)
|
|
|
|
|
2008-03-23 08:03:58 +00:00
|
|
|
static inline int handle_vm86_trap(struct kernel_vm86_regs *a, long b, int c)
|
|
|
|
{
|
2006-01-08 09:05:26 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-07-29 05:41:19 +00:00
|
|
|
static inline void save_v86_state(struct kernel_vm86_regs *a, int b) { }
|
|
|
|
|
2015-07-29 05:41:16 +00:00
|
|
|
#define free_vm86(t) do { } while(0)
|
|
|
|
|
2006-01-08 09:05:26 +00:00
|
|
|
#endif /* CONFIG_VM86 */
|
|
|
|
|
2008-10-23 05:26:29 +00:00
|
|
|
#endif /* _ASM_X86_VM86_H */
|