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