root / bsd-user / i386 / syscall.h @ 067d01de
History | View | Annotate | Download (3.5 kB)
1 | 31fc12df | blueswir1 | /* default linux values for the selectors */
|
---|---|---|---|
2 | 31fc12df | blueswir1 | #define __USER_CS (0x23) |
3 | 31fc12df | blueswir1 | #define __USER_DS (0x2B) |
4 | 31fc12df | blueswir1 | |
5 | 31fc12df | blueswir1 | struct target_pt_regs {
|
6 | 31fc12df | blueswir1 | long ebx;
|
7 | 31fc12df | blueswir1 | long ecx;
|
8 | 31fc12df | blueswir1 | long edx;
|
9 | 31fc12df | blueswir1 | long esi;
|
10 | 31fc12df | blueswir1 | long edi;
|
11 | 31fc12df | blueswir1 | long ebp;
|
12 | 31fc12df | blueswir1 | long eax;
|
13 | 31fc12df | blueswir1 | int xds;
|
14 | 31fc12df | blueswir1 | int xes;
|
15 | 31fc12df | blueswir1 | long orig_eax;
|
16 | 31fc12df | blueswir1 | long eip;
|
17 | 31fc12df | blueswir1 | int xcs;
|
18 | 31fc12df | blueswir1 | long eflags;
|
19 | 31fc12df | blueswir1 | long esp;
|
20 | 31fc12df | blueswir1 | int xss;
|
21 | 31fc12df | blueswir1 | }; |
22 | 31fc12df | blueswir1 | |
23 | 31fc12df | blueswir1 | /* ioctls */
|
24 | 31fc12df | blueswir1 | |
25 | 31fc12df | blueswir1 | #define TARGET_LDT_ENTRIES 8192 |
26 | 31fc12df | blueswir1 | #define TARGET_LDT_ENTRY_SIZE 8 |
27 | 31fc12df | blueswir1 | |
28 | 31fc12df | blueswir1 | #define TARGET_GDT_ENTRIES 9 |
29 | 31fc12df | blueswir1 | #define TARGET_GDT_ENTRY_TLS_ENTRIES 3 |
30 | 31fc12df | blueswir1 | #define TARGET_GDT_ENTRY_TLS_MIN 6 |
31 | 31fc12df | blueswir1 | #define TARGET_GDT_ENTRY_TLS_MAX (TARGET_GDT_ENTRY_TLS_MIN + TARGET_GDT_ENTRY_TLS_ENTRIES - 1) |
32 | 31fc12df | blueswir1 | |
33 | 31fc12df | blueswir1 | struct target_modify_ldt_ldt_s {
|
34 | 31fc12df | blueswir1 | unsigned int entry_number; |
35 | 31fc12df | blueswir1 | abi_ulong base_addr; |
36 | 31fc12df | blueswir1 | unsigned int limit; |
37 | 31fc12df | blueswir1 | unsigned int flags; |
38 | 31fc12df | blueswir1 | }; |
39 | 31fc12df | blueswir1 | |
40 | 31fc12df | blueswir1 | /* vm86 defines */
|
41 | 31fc12df | blueswir1 | |
42 | 31fc12df | blueswir1 | #define TARGET_BIOSSEG 0x0f000 |
43 | 31fc12df | blueswir1 | |
44 | 31fc12df | blueswir1 | #define TARGET_CPU_086 0 |
45 | 31fc12df | blueswir1 | #define TARGET_CPU_186 1 |
46 | 31fc12df | blueswir1 | #define TARGET_CPU_286 2 |
47 | 31fc12df | blueswir1 | #define TARGET_CPU_386 3 |
48 | 31fc12df | blueswir1 | #define TARGET_CPU_486 4 |
49 | 31fc12df | blueswir1 | #define TARGET_CPU_586 5 |
50 | 31fc12df | blueswir1 | |
51 | 31fc12df | blueswir1 | #define TARGET_VM86_SIGNAL 0 /* return due to signal */ |
52 | 31fc12df | blueswir1 | #define TARGET_VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */ |
53 | 31fc12df | blueswir1 | #define TARGET_VM86_INTx 2 /* int3/int x instruction (ARG = x) */ |
54 | 31fc12df | blueswir1 | #define TARGET_VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */ |
55 | 31fc12df | blueswir1 | |
56 | 31fc12df | blueswir1 | /*
|
57 | 31fc12df | blueswir1 | * Additional return values when invoking new vm86()
|
58 | 31fc12df | blueswir1 | */
|
59 | 31fc12df | blueswir1 | #define TARGET_VM86_PICRETURN 4 /* return due to pending PIC request */ |
60 | 31fc12df | blueswir1 | #define TARGET_VM86_TRAP 6 /* return due to DOS-debugger request */ |
61 | 31fc12df | blueswir1 | |
62 | 31fc12df | blueswir1 | /*
|
63 | 31fc12df | blueswir1 | * function codes when invoking new vm86()
|
64 | 31fc12df | blueswir1 | */
|
65 | 31fc12df | blueswir1 | #define TARGET_VM86_PLUS_INSTALL_CHECK 0 |
66 | 31fc12df | blueswir1 | #define TARGET_VM86_ENTER 1 |
67 | 31fc12df | blueswir1 | #define TARGET_VM86_ENTER_NO_BYPASS 2 |
68 | 31fc12df | blueswir1 | #define TARGET_VM86_REQUEST_IRQ 3 |
69 | 31fc12df | blueswir1 | #define TARGET_VM86_FREE_IRQ 4 |
70 | 31fc12df | blueswir1 | #define TARGET_VM86_GET_IRQ_BITS 5 |
71 | 31fc12df | blueswir1 | #define TARGET_VM86_GET_AND_RESET_IRQ 6 |
72 | 31fc12df | blueswir1 | |
73 | 31fc12df | blueswir1 | /*
|
74 | 31fc12df | blueswir1 | * This is the stack-layout seen by the user space program when we have
|
75 | 31fc12df | blueswir1 | * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
|
76 | 31fc12df | blueswir1 | * is 'kernel_vm86_regs' (see below).
|
77 | 31fc12df | blueswir1 | */
|
78 | 31fc12df | blueswir1 | |
79 | 31fc12df | blueswir1 | struct target_vm86_regs {
|
80 | 31fc12df | blueswir1 | /*
|
81 | 31fc12df | blueswir1 | * normal regs, with special meaning for the segment descriptors..
|
82 | 31fc12df | blueswir1 | */
|
83 | 31fc12df | blueswir1 | abi_long ebx; |
84 | 31fc12df | blueswir1 | abi_long ecx; |
85 | 31fc12df | blueswir1 | abi_long edx; |
86 | 31fc12df | blueswir1 | abi_long esi; |
87 | 31fc12df | blueswir1 | abi_long edi; |
88 | 31fc12df | blueswir1 | abi_long ebp; |
89 | 31fc12df | blueswir1 | abi_long eax; |
90 | 31fc12df | blueswir1 | abi_long __null_ds; |
91 | 31fc12df | blueswir1 | abi_long __null_es; |
92 | 31fc12df | blueswir1 | abi_long __null_fs; |
93 | 31fc12df | blueswir1 | abi_long __null_gs; |
94 | 31fc12df | blueswir1 | abi_long orig_eax; |
95 | 31fc12df | blueswir1 | abi_long eip; |
96 | 31fc12df | blueswir1 | unsigned short cs, __csh; |
97 | 31fc12df | blueswir1 | abi_long eflags; |
98 | 31fc12df | blueswir1 | abi_long esp; |
99 | 31fc12df | blueswir1 | unsigned short ss, __ssh; |
100 | 31fc12df | blueswir1 | /*
|
101 | 31fc12df | blueswir1 | * these are specific to v86 mode:
|
102 | 31fc12df | blueswir1 | */
|
103 | 31fc12df | blueswir1 | unsigned short es, __esh; |
104 | 31fc12df | blueswir1 | unsigned short ds, __dsh; |
105 | 31fc12df | blueswir1 | unsigned short fs, __fsh; |
106 | 31fc12df | blueswir1 | unsigned short gs, __gsh; |
107 | 31fc12df | blueswir1 | }; |
108 | 31fc12df | blueswir1 | |
109 | 31fc12df | blueswir1 | struct target_revectored_struct {
|
110 | 31fc12df | blueswir1 | abi_ulong __map[8]; /* 256 bits */ |
111 | 31fc12df | blueswir1 | }; |
112 | 31fc12df | blueswir1 | |
113 | 31fc12df | blueswir1 | struct target_vm86_struct {
|
114 | 31fc12df | blueswir1 | struct target_vm86_regs regs;
|
115 | 31fc12df | blueswir1 | abi_ulong flags; |
116 | 31fc12df | blueswir1 | abi_ulong screen_bitmap; |
117 | 31fc12df | blueswir1 | abi_ulong cpu_type; |
118 | 31fc12df | blueswir1 | struct target_revectored_struct int_revectored;
|
119 | 31fc12df | blueswir1 | struct target_revectored_struct int21_revectored;
|
120 | 31fc12df | blueswir1 | }; |
121 | 31fc12df | blueswir1 | |
122 | 31fc12df | blueswir1 | /*
|
123 | 31fc12df | blueswir1 | * flags masks
|
124 | 31fc12df | blueswir1 | */
|
125 | 31fc12df | blueswir1 | #define TARGET_VM86_SCREEN_BITMAP 0x0001 |
126 | 31fc12df | blueswir1 | |
127 | 31fc12df | blueswir1 | struct target_vm86plus_info_struct {
|
128 | 31fc12df | blueswir1 | abi_ulong flags; |
129 | 31fc12df | blueswir1 | #define TARGET_force_return_for_pic (1 << 0) |
130 | 31fc12df | blueswir1 | #define TARGET_vm86dbg_active (1 << 1) /* for debugger */ |
131 | 31fc12df | blueswir1 | #define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */ |
132 | 31fc12df | blueswir1 | #define TARGET_is_vm86pus (1 << 31) /* for vm86 internal use */ |
133 | 31fc12df | blueswir1 | unsigned char vm86dbg_intxxtab[32]; /* for debugger */ |
134 | 31fc12df | blueswir1 | }; |
135 | 31fc12df | blueswir1 | |
136 | 31fc12df | blueswir1 | struct target_vm86plus_struct {
|
137 | 31fc12df | blueswir1 | struct target_vm86_regs regs;
|
138 | 31fc12df | blueswir1 | abi_ulong flags; |
139 | 31fc12df | blueswir1 | abi_ulong screen_bitmap; |
140 | 31fc12df | blueswir1 | abi_ulong cpu_type; |
141 | 31fc12df | blueswir1 | struct target_revectored_struct int_revectored;
|
142 | 31fc12df | blueswir1 | struct target_revectored_struct int21_revectored;
|
143 | 31fc12df | blueswir1 | struct target_vm86plus_info_struct vm86plus;
|
144 | 31fc12df | blueswir1 | }; |
145 | 31fc12df | blueswir1 | |
146 | 31fc12df | blueswir1 | #define UNAME_MACHINE "i386" |