1 #ifndef _ASM_X86_VM86_H
2 #define _ASM_X86_VM86_H
5 #include <asm/ptrace.h>
6 #include <uapi/asm/vm86.h>
9 * This is the (kernel) stack-layout when we have done a "SAVE_ALL" from vm86
10 * mode - the main change is that the old segment descriptors aren't
11 * useful any more and are forced to be zero by the kernel (and the
12 * hardware when a trap occurs), and the real segment descriptors are
13 * at the end of the structure. Look at ptrace.h to see the "normal"
14 * setup. For user space layout see 'struct vm86_regs' above.
17 struct kernel_vm86_regs
{
19 * normal regs, with special meaning for the segment descriptors..
23 * these are specific to v86 mode:
25 unsigned short es
, __esh
;
26 unsigned short ds
, __dsh
;
27 unsigned short fs
, __fsh
;
28 unsigned short gs
, __gsh
;
31 struct kernel_vm86_struct
{
32 struct kernel_vm86_regs regs
;
34 * the below part remains on the kernel stack while we are in VM86 mode.
35 * 'tss.esp0' then contains the address of VM86_TSS_ESP0 below, and when we
36 * get forced back from VM86, the CPU and "SAVE_ALL" will restore the above
37 * 'struct kernel_vm86_regs' with the then actual values.
38 * Therefore, pt_regs in fact points to a complete 'kernel_vm86_struct'
39 * in kernelspace, hence we need not reget the data from userspace.
41 #define VM86_TSS_ESP0 flags
43 unsigned long screen_bitmap
;
44 unsigned long cpu_type
;
45 struct revectored_struct int_revectored
;
46 struct revectored_struct int21_revectored
;
47 struct vm86plus_info_struct vm86plus
;
48 struct pt_regs
*regs32
; /* here we save the pointer to the old regs */
50 * The below is not part of the structure, but the stack layout continues
51 * this way. In front of 'return-eip' may be some data, depending on
52 * compilation, so we don't rely on this and save the pointer to 'oldregs'
54 * However, with GCC-2.7.2 and the current CFLAGS you see exactly this:
56 long return-eip; from call to vm86()
57 struct pt_regs oldregs; user space registers as saved by syscall
63 void handle_vm86_fault(struct kernel_vm86_regs
*, long);
64 int handle_vm86_trap(struct kernel_vm86_regs
*, long, int);
65 struct pt_regs
*save_v86_state(struct kernel_vm86_regs
*);
68 void release_vm86_irqs(struct task_struct
*);
72 #define handle_vm86_fault(a, b)
73 #define release_vm86_irqs(a)
75 static inline int handle_vm86_trap(struct kernel_vm86_regs
*a
, long b
, int c
)
80 #endif /* CONFIG_VM86 */
82 #endif /* _ASM_X86_VM86_H */