* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / libc / include / linux / vm86.h
blob851814e1398fe873dd304738f2df08bf8362f362
1 #if !__AS386_16__
3 #ifndef _SYS_VM86_H
4 #define _SYS_VM86_H
6 #include <features.h>
7 #ifndef _LINUX_VM86_H
8 #define _LINUX_VM86_H
11 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
12 * the Pentium uses them. Linux will return from vm86 mode when both
13 * VIF and VIP is set.
15 * On a Pentium, we could probably optimize the virtual flags directly
16 * in the eflags register instead of doing it "by hand" in vflags...
18 * Linus
21 #define TF_MASK 0x00000100
22 #define IF_MASK 0x00000200
23 #define IOPL_MASK 0x00003000
24 #define NT_MASK 0x00004000
25 #define VM_MASK 0x00020000
26 #define AC_MASK 0x00040000
27 #define VIF_MASK 0x00080000 /* virtual interrupt flag */
28 #define VIP_MASK 0x00100000 /* virtual interrupt pending */
29 #define ID_MASK 0x00200000
31 #define BIOSSEG 0x0f000
33 #define CPU_086 0
34 #define CPU_186 1
35 #define CPU_286 2
36 #define CPU_386 3
37 #define CPU_486 4
38 #define CPU_586 5
41 * Return values for the 'vm86()' system call
43 #define VM86_TYPE(retval) ((retval) & 0xff)
44 #define VM86_ARG(retval) ((retval) >> 8)
46 #define VM86_SIGNAL 0 /* return due to signal */
47 #define VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */
48 #define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
49 #define VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */
52 * This is the stack-layout when we have done a "SAVE_ALL" from vm86
53 * mode - the main change is that the old segment descriptors aren't
54 * useful any more and are forced to be zero by the kernel (and the
55 * hardware when a trap occurs), and the real segment descriptors are
56 * at the end of the structure. Look at ptrace.h to see the "normal"
57 * setup.
60 struct vm86_regs {
62 * normal regs, with special meaning for the segment descriptors..
64 long ebx;
65 long ecx;
66 long edx;
67 long esi;
68 long edi;
69 long ebp;
70 long eax;
71 long __null_ds;
72 long __null_es;
73 long __null_fs;
74 long __null_gs;
75 long orig_eax;
76 long eip;
77 unsigned short cs, __csh;
78 long eflags;
79 long esp;
80 unsigned short ss, __ssh;
82 * these are specific to v86 mode:
84 unsigned short es, __esh;
85 unsigned short ds, __dsh;
86 unsigned short fs, __fsh;
87 unsigned short gs, __gsh;
90 struct revectored_struct {
91 unsigned long __map[8]; /* 256 bits */
94 struct vm86_struct {
95 struct vm86_regs regs;
96 unsigned long flags;
97 unsigned long screen_bitmap;
98 unsigned long cpu_type;
99 struct revectored_struct int_revectored;
100 struct revectored_struct int21_revectored;
104 * flags masks
106 #define VM86_SCREEN_BITMAP 0x0001
108 #ifdef __KERNEL__
110 void handle_vm86_fault(struct vm86_regs *, long);
111 void handle_vm86_debug(struct vm86_regs *, long);
113 #endif
115 #endif
117 __BEGIN_DECLS
119 extern vm86(struct vm86_struct * __info);
121 __END_DECLS
123 #endif /*_SYS_VM86_H */
125 #endif