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