root / syscall-i386.h @ dbc5594c
History | View | Annotate | Download (5.5 kB)
1 | 9de5e440 | bellard | /* default linux values for the selectors */
|
---|---|---|---|
2 | 9de5e440 | bellard | #define __USER_CS (0x23) |
3 | 9de5e440 | bellard | #define __USER_DS (0x2B) |
4 | 9de5e440 | bellard | |
5 | 9de5e440 | bellard | struct target_pt_regs {
|
6 | 9de5e440 | bellard | long ebx;
|
7 | 9de5e440 | bellard | long ecx;
|
8 | 9de5e440 | bellard | long edx;
|
9 | 9de5e440 | bellard | long esi;
|
10 | 9de5e440 | bellard | long edi;
|
11 | 9de5e440 | bellard | long ebp;
|
12 | 9de5e440 | bellard | long eax;
|
13 | 9de5e440 | bellard | int xds;
|
14 | 9de5e440 | bellard | int xes;
|
15 | 9de5e440 | bellard | long orig_eax;
|
16 | 9de5e440 | bellard | long eip;
|
17 | 9de5e440 | bellard | int xcs;
|
18 | 9de5e440 | bellard | long eflags;
|
19 | 9de5e440 | bellard | long esp;
|
20 | 9de5e440 | bellard | int xss;
|
21 | 9de5e440 | bellard | }; |
22 | 9de5e440 | bellard | |
23 | 31e31b8a | bellard | /* ioctls */
|
24 | 31e31b8a | bellard | |
25 | 1a9353d2 | bellard | #define TARGET_LDT_ENTRIES 8192 |
26 | 1a9353d2 | bellard | #define TARGET_LDT_ENTRY_SIZE 8 |
27 | 1a9353d2 | bellard | |
28 | 7ed601b7 | bellard | #define TARGET_GDT_ENTRY_TLS_ENTRIES 3 |
29 | 7ed601b7 | bellard | #define TARGET_GDT_ENTRY_TLS_MIN 6 |
30 | 7ed601b7 | bellard | #define TARGET_GDT_ENTRY_TLS_MAX (TARGET_GDT_ENTRY_TLS_MIN + TARGET_GDT_ENTRY_TLS_ENTRIES - 1) |
31 | 7ed601b7 | bellard | |
32 | 1a9353d2 | bellard | struct target_modify_ldt_ldt_s {
|
33 | 1a9353d2 | bellard | unsigned int entry_number; |
34 | 1a9353d2 | bellard | target_ulong base_addr; |
35 | 1a9353d2 | bellard | unsigned int limit; |
36 | 1a9353d2 | bellard | unsigned int flags; |
37 | 1a9353d2 | bellard | }; |
38 | 1a9353d2 | bellard | |
39 | bc8a22cc | bellard | /* vm86 defines */
|
40 | bc8a22cc | bellard | |
41 | bc8a22cc | bellard | #define TARGET_BIOSSEG 0x0f000 |
42 | bc8a22cc | bellard | |
43 | b333af06 | bellard | #define TARGET_CPU_086 0 |
44 | b333af06 | bellard | #define TARGET_CPU_186 1 |
45 | b333af06 | bellard | #define TARGET_CPU_286 2 |
46 | b333af06 | bellard | #define TARGET_CPU_386 3 |
47 | b333af06 | bellard | #define TARGET_CPU_486 4 |
48 | b333af06 | bellard | #define TARGET_CPU_586 5 |
49 | b333af06 | bellard | |
50 | 7ed601b7 | bellard | #define TARGET_VM86_SIGNAL 0 /* return due to signal */ |
51 | 7ed601b7 | bellard | #define TARGET_VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */ |
52 | 7ed601b7 | bellard | #define TARGET_VM86_INTx 2 /* int3/int x instruction (ARG = x) */ |
53 | 7ed601b7 | bellard | #define TARGET_VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */ |
54 | 7ed601b7 | bellard | |
55 | 7ed601b7 | bellard | /*
|
56 | 7ed601b7 | bellard | * Additional return values when invoking new vm86()
|
57 | 7ed601b7 | bellard | */
|
58 | 7ed601b7 | bellard | #define TARGET_VM86_PICRETURN 4 /* return due to pending PIC request */ |
59 | 7ed601b7 | bellard | #define TARGET_VM86_TRAP 6 /* return due to DOS-debugger request */ |
60 | 7ed601b7 | bellard | |
61 | 7ed601b7 | bellard | /*
|
62 | 7ed601b7 | bellard | * function codes when invoking new vm86()
|
63 | 7ed601b7 | bellard | */
|
64 | 7ed601b7 | bellard | #define TARGET_VM86_PLUS_INSTALL_CHECK 0 |
65 | 7ed601b7 | bellard | #define TARGET_VM86_ENTER 1 |
66 | 7ed601b7 | bellard | #define TARGET_VM86_ENTER_NO_BYPASS 2 |
67 | 7ed601b7 | bellard | #define TARGET_VM86_REQUEST_IRQ 3 |
68 | 7ed601b7 | bellard | #define TARGET_VM86_FREE_IRQ 4 |
69 | 7ed601b7 | bellard | #define TARGET_VM86_GET_IRQ_BITS 5 |
70 | 7ed601b7 | bellard | #define TARGET_VM86_GET_AND_RESET_IRQ 6 |
71 | 7ed601b7 | bellard | |
72 | 7ed601b7 | bellard | /*
|
73 | 7ed601b7 | bellard | * This is the stack-layout seen by the user space program when we have
|
74 | 7ed601b7 | bellard | * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
|
75 | 7ed601b7 | bellard | * is 'kernel_vm86_regs' (see below).
|
76 | 7ed601b7 | bellard | */
|
77 | 7ed601b7 | bellard | |
78 | 7ed601b7 | bellard | struct target_vm86_regs {
|
79 | 7ed601b7 | bellard | /*
|
80 | 7ed601b7 | bellard | * normal regs, with special meaning for the segment descriptors..
|
81 | 7ed601b7 | bellard | */
|
82 | 7ed601b7 | bellard | target_long ebx; |
83 | 7ed601b7 | bellard | target_long ecx; |
84 | 7ed601b7 | bellard | target_long edx; |
85 | 7ed601b7 | bellard | target_long esi; |
86 | 7ed601b7 | bellard | target_long edi; |
87 | 7ed601b7 | bellard | target_long ebp; |
88 | 7ed601b7 | bellard | target_long eax; |
89 | 7ed601b7 | bellard | target_long __null_ds; |
90 | 7ed601b7 | bellard | target_long __null_es; |
91 | 7ed601b7 | bellard | target_long __null_fs; |
92 | 7ed601b7 | bellard | target_long __null_gs; |
93 | 7ed601b7 | bellard | target_long orig_eax; |
94 | 7ed601b7 | bellard | target_long eip; |
95 | 7ed601b7 | bellard | unsigned short cs, __csh; |
96 | 7ed601b7 | bellard | target_long eflags; |
97 | 7ed601b7 | bellard | target_long esp; |
98 | 7ed601b7 | bellard | unsigned short ss, __ssh; |
99 | 7ed601b7 | bellard | /*
|
100 | 7ed601b7 | bellard | * these are specific to v86 mode:
|
101 | 7ed601b7 | bellard | */
|
102 | 7ed601b7 | bellard | unsigned short es, __esh; |
103 | 7ed601b7 | bellard | unsigned short ds, __dsh; |
104 | 7ed601b7 | bellard | unsigned short fs, __fsh; |
105 | 7ed601b7 | bellard | unsigned short gs, __gsh; |
106 | 7ed601b7 | bellard | }; |
107 | 7ed601b7 | bellard | |
108 | 7ed601b7 | bellard | struct target_revectored_struct {
|
109 | 7ed601b7 | bellard | target_ulong __map[8]; /* 256 bits */ |
110 | 7ed601b7 | bellard | }; |
111 | 7ed601b7 | bellard | |
112 | 7ed601b7 | bellard | struct target_vm86_struct {
|
113 | 7ed601b7 | bellard | struct target_vm86_regs regs;
|
114 | 7ed601b7 | bellard | target_ulong flags; |
115 | 7ed601b7 | bellard | target_ulong screen_bitmap; |
116 | 7ed601b7 | bellard | target_ulong cpu_type; |
117 | 7ed601b7 | bellard | struct target_revectored_struct int_revectored;
|
118 | 7ed601b7 | bellard | struct target_revectored_struct int21_revectored;
|
119 | 7ed601b7 | bellard | }; |
120 | 7ed601b7 | bellard | |
121 | 7ed601b7 | bellard | /*
|
122 | 7ed601b7 | bellard | * flags masks
|
123 | 7ed601b7 | bellard | */
|
124 | 7ed601b7 | bellard | #define TARGET_VM86_SCREEN_BITMAP 0x0001 |
125 | 7ed601b7 | bellard | |
126 | 7ed601b7 | bellard | struct target_vm86plus_info_struct {
|
127 | 7ed601b7 | bellard | target_ulong flags; |
128 | 7ed601b7 | bellard | #define TARGET_force_return_for_pic (1 << 0) |
129 | 7ed601b7 | bellard | #define TARGET_vm86dbg_active (1 << 1) /* for debugger */ |
130 | 7ed601b7 | bellard | #define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */ |
131 | 7ed601b7 | bellard | #define TARGET_is_vm86pus (1 << 31) /* for vm86 internal use */ |
132 | 7ed601b7 | bellard | unsigned char vm86dbg_intxxtab[32]; /* for debugger */ |
133 | 7ed601b7 | bellard | }; |
134 | 7ed601b7 | bellard | |
135 | 7ed601b7 | bellard | struct target_vm86plus_struct {
|
136 | 7ed601b7 | bellard | struct target_vm86_regs regs;
|
137 | 7ed601b7 | bellard | target_ulong flags; |
138 | 7ed601b7 | bellard | target_ulong screen_bitmap; |
139 | 7ed601b7 | bellard | target_ulong cpu_type; |
140 | 7ed601b7 | bellard | struct target_revectored_struct int_revectored;
|
141 | 7ed601b7 | bellard | struct target_revectored_struct int21_revectored;
|
142 | 7ed601b7 | bellard | struct target_vm86plus_info_struct vm86plus;
|
143 | 7ed601b7 | bellard | }; |
144 | 7ed601b7 | bellard | |
145 | 7ed601b7 | bellard | /* ipcs */
|
146 | 7ed601b7 | bellard | |
147 | 7ed601b7 | bellard | #define TARGET_SEMOP 1 |
148 | 7ed601b7 | bellard | #define TARGET_SEMGET 2 |
149 | 7ed601b7 | bellard | #define TARGET_SEMCTL 3 |
150 | 7ed601b7 | bellard | #define TARGET_MSGSND 11 |
151 | 7ed601b7 | bellard | #define TARGET_MSGRCV 12 |
152 | 7ed601b7 | bellard | #define TARGET_MSGGET 13 |
153 | 7ed601b7 | bellard | #define TARGET_MSGCTL 14 |
154 | 7ed601b7 | bellard | #define TARGET_SHMAT 21 |
155 | 7ed601b7 | bellard | #define TARGET_SHMDT 22 |
156 | 7ed601b7 | bellard | #define TARGET_SHMGET 23 |
157 | 7ed601b7 | bellard | #define TARGET_SHMCTL 24 |
158 | 7ed601b7 | bellard | |
159 | 7ed601b7 | bellard | struct target_msgbuf {
|
160 | 7ed601b7 | bellard | int mtype;
|
161 | 7ed601b7 | bellard | char mtext[1]; |
162 | 7ed601b7 | bellard | }; |
163 | 7ed601b7 | bellard | |
164 | 7ed601b7 | bellard | struct target_ipc_kludge {
|
165 | 7ed601b7 | bellard | unsigned int msgp; /* Really (struct msgbuf *) */ |
166 | 7ed601b7 | bellard | int msgtyp;
|
167 | 7ed601b7 | bellard | }; |
168 | 7ed601b7 | bellard | |
169 | 7ed601b7 | bellard | struct target_ipc_perm {
|
170 | 7ed601b7 | bellard | int key;
|
171 | 7ed601b7 | bellard | unsigned short uid; |
172 | 7ed601b7 | bellard | unsigned short gid; |
173 | 7ed601b7 | bellard | unsigned short cuid; |
174 | 7ed601b7 | bellard | unsigned short cgid; |
175 | 7ed601b7 | bellard | unsigned short mode; |
176 | 7ed601b7 | bellard | unsigned short seq; |
177 | 7ed601b7 | bellard | }; |
178 | 7ed601b7 | bellard | |
179 | 7ed601b7 | bellard | struct target_msqid_ds {
|
180 | 7ed601b7 | bellard | struct target_ipc_perm msg_perm;
|
181 | 7ed601b7 | bellard | unsigned int msg_first; /* really struct target_msg* */ |
182 | 7ed601b7 | bellard | unsigned int msg_last; /* really struct target_msg* */ |
183 | 7ed601b7 | bellard | unsigned int msg_stime; /* really target_time_t */ |
184 | 7ed601b7 | bellard | unsigned int msg_rtime; /* really target_time_t */ |
185 | 7ed601b7 | bellard | unsigned int msg_ctime; /* really target_time_t */ |
186 | 7ed601b7 | bellard | unsigned int wwait; /* really struct wait_queue* */ |
187 | 7ed601b7 | bellard | unsigned int rwait; /* really struct wait_queue* */ |
188 | 7ed601b7 | bellard | unsigned short msg_cbytes; |
189 | 7ed601b7 | bellard | unsigned short msg_qnum; |
190 | 7ed601b7 | bellard | unsigned short msg_qbytes; |
191 | 7ed601b7 | bellard | unsigned short msg_lspid; |
192 | 7ed601b7 | bellard | unsigned short msg_lrpid; |
193 | 7ed601b7 | bellard | }; |
194 | 7ed601b7 | bellard | |
195 | 7ed601b7 | bellard | struct target_shmid_ds {
|
196 | 7ed601b7 | bellard | struct target_ipc_perm shm_perm;
|
197 | 7ed601b7 | bellard | int shm_segsz;
|
198 | 7ed601b7 | bellard | unsigned int shm_atime; /* really target_time_t */ |
199 | 7ed601b7 | bellard | unsigned int shm_dtime; /* really target_time_t */ |
200 | 7ed601b7 | bellard | unsigned int shm_ctime; /* really target_time_t */ |
201 | 7ed601b7 | bellard | unsigned short shm_cpid; |
202 | 7ed601b7 | bellard | unsigned short shm_lpid; |
203 | 7ed601b7 | bellard | short shm_nattch;
|
204 | 7ed601b7 | bellard | unsigned short shm_npages; |
205 | 7ed601b7 | bellard | unsigned long *shm_pages; |
206 | 7ed601b7 | bellard | void *attaches; /* really struct shm_desc * */ |
207 | 7ed601b7 | bellard | }; |
208 | 7ed601b7 | bellard | |
209 | 7ed601b7 | bellard | #define TARGET_IPC_RMID 0 |
210 | 7ed601b7 | bellard | #define TARGET_IPC_SET 1 |
211 | 7ed601b7 | bellard | #define TARGET_IPC_STAT 2 |
212 | 7ed601b7 | bellard | |
213 | 7ed601b7 | bellard | union target_semun {
|
214 | 7ed601b7 | bellard | int val;
|
215 | 7ed601b7 | bellard | unsigned int buf; /* really struct semid_ds * */ |
216 | 7ed601b7 | bellard | unsigned int array; /* really unsigned short * */ |
217 | 7ed601b7 | bellard | unsigned int __buf; /* really struct seminfo * */ |
218 | 7ed601b7 | bellard | unsigned int __pad; /* really void* */ |
219 | 7ed601b7 | bellard | }; |