1 #ifndef _LINUX_VM86_H
2 #define _LINUX_VM86_H
3
4
5
6
7
8
9
10
11
12
13
14
15 #define TF_MASK 0x00000100
16 #define IF_MASK 0x00000200
17 #define IOPL_MASK 0x00003000
18 #define NT_MASK 0x00004000
19 #define VM_MASK 0x00020000
20 #define AC_MASK 0x00040000
21 #define VIF_MASK 0x00080000
22 #define VIP_MASK 0x00100000
23 #define ID_MASK 0x00200000
24
25 #define BIOSSEG 0x0f000
26
27 #define CPU_086 0
28 #define CPU_186 1
29 #define CPU_286 2
30 #define CPU_386 3
31 #define CPU_486 4
32 #define CPU_586 5
33
34
35
36
37 #define VM86_TYPE(retval) ((retval) & 0xff)
38 #define VM86_ARG(retval) ((retval) >> 8)
39
40 #define VM86_SIGNAL 0
41 #define VM86_UNKNOWN 1
42 #define VM86_INTx 2
43 #define VM86_STI 3
44
45
46
47
48
49
50
51
52
53
54 struct vm86_regs {
55
56
57
58 long ebx;
59 long ecx;
60 long edx;
61 long esi;
62 long edi;
63 long ebp;
64 long eax;
65 long __null_ds;
66 long __null_es;
67 long __null_fs;
68 long __null_gs;
69 long orig_eax;
70 long eip;
71 unsigned short cs, __csh;
72 long eflags;
73 long esp;
74 unsigned short ss, __ssh;
75
76
77
78 unsigned short es, __esh;
79 unsigned short ds, __dsh;
80 unsigned short fs, __fsh;
81 unsigned short gs, __gsh;
82 };
83
84 struct revectored_struct {
85 unsigned long __map[8];
86 };
87
88 struct vm86_struct {
89 struct vm86_regs regs;
90 unsigned long flags;
91 unsigned long screen_bitmap;
92 unsigned long cpu_type;
93 struct revectored_struct int_revectored;
94 struct revectored_struct int21_revectored;
95 };
96
97
98
99
100 #define VM86_SCREEN_BITMAP 0x0001
101
102 #ifdef __KERNEL__
103
104 void handle_vm86_fault(struct vm86_regs *, long);
105 void handle_vm86_debug(struct vm86_regs *, long);
106
107 #endif
108
109 #endif