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