Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / x86 / include / uapi / asm / vm86.h
blobe0b243e9d859841e087b1ef022519f374304018d
1 #ifndef _UAPI_ASM_X86_VM86_H
2 #define _UAPI_ASM_X86_VM86_H
4 /*
5 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
6 * the Pentium uses them. Linux will return from vm86 mode when both
7 * VIF and VIP is set.
9 * On a Pentium, we could probably optimize the virtual flags directly
10 * in the eflags register instead of doing it "by hand" in vflags...
12 * Linus
15 #include <asm/processor-flags.h>
17 #define BIOSSEG 0x0f000
19 #define CPU_086 0
20 #define CPU_186 1
21 #define CPU_286 2
22 #define CPU_386 3
23 #define CPU_486 4
24 #define CPU_586 5
27 * Return values for the 'vm86()' system call
29 #define VM86_TYPE(retval) ((retval) & 0xff)
30 #define VM86_ARG(retval) ((retval) >> 8)
32 #define VM86_SIGNAL 0 /* return due to signal */
33 #define VM86_UNKNOWN 1 /* unhandled GP fault
34 - IO-instruction or similar */
35 #define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
36 #define VM86_STI 3 /* sti/popf/iret instruction enabled
37 virtual interrupts */
40 * Additional return values when invoking new vm86()
42 #define VM86_PICRETURN 4 /* return due to pending PIC request */
43 #define VM86_TRAP 6 /* return due to DOS-debugger request */
46 * function codes when invoking new vm86()
48 #define VM86_PLUS_INSTALL_CHECK 0
49 #define VM86_ENTER 1
50 #define VM86_ENTER_NO_BYPASS 2
51 #define VM86_REQUEST_IRQ 3
52 #define VM86_FREE_IRQ 4
53 #define VM86_GET_IRQ_BITS 5
54 #define VM86_GET_AND_RESET_IRQ 6
57 * This is the stack-layout seen by the user space program when we have
58 * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
59 * is 'kernel_vm86_regs' (see below).
62 struct vm86_regs {
64 * normal regs, with special meaning for the segment descriptors..
66 long ebx;
67 long ecx;
68 long edx;
69 long esi;
70 long edi;
71 long ebp;
72 long eax;
73 long __null_ds;
74 long __null_es;
75 long __null_fs;
76 long __null_gs;
77 long orig_eax;
78 long eip;
79 unsigned short cs, __csh;
80 long eflags;
81 long esp;
82 unsigned short ss, __ssh;
84 * these are specific to v86 mode:
86 unsigned short es, __esh;
87 unsigned short ds, __dsh;
88 unsigned short fs, __fsh;
89 unsigned short gs, __gsh;
92 struct revectored_struct {
93 unsigned long __map[8]; /* 256 bits */
96 struct vm86_struct {
97 struct vm86_regs regs;
98 unsigned long flags;
99 unsigned long screen_bitmap;
100 unsigned long cpu_type;
101 struct revectored_struct int_revectored;
102 struct revectored_struct int21_revectored;
106 * flags masks
108 #define VM86_SCREEN_BITMAP 0x0001
110 struct vm86plus_info_struct {
111 unsigned long force_return_for_pic:1;
112 unsigned long vm86dbg_active:1; /* for debugger */
113 unsigned long vm86dbg_TFpendig:1; /* for debugger */
114 unsigned long unused:28;
115 unsigned long is_vm86pus:1; /* for vm86 internal use */
116 unsigned char vm86dbg_intxxtab[32]; /* for debugger */
118 struct vm86plus_struct {
119 struct vm86_regs regs;
120 unsigned long flags;
121 unsigned long screen_bitmap;
122 unsigned long cpu_type;
123 struct revectored_struct int_revectored;
124 struct revectored_struct int21_revectored;
125 struct vm86plus_info_struct vm86plus;
129 #endif /* _UAPI_ASM_X86_VM86_H */