2016-06-29 11:47:26 +03:00
|
|
|
#ifndef I386_TARGET_SYSCALL_H
|
|
|
|
#define I386_TARGET_SYSCALL_H
|
2016-02-01 21:38:42 +03:00
|
|
|
|
2003-10-01 00:34:21 +04:00
|
|
|
/* default linux values for the selectors */
|
|
|
|
#define __USER_CS (0x23)
|
|
|
|
#define __USER_DS (0x2B)
|
|
|
|
|
|
|
|
struct target_pt_regs {
|
|
|
|
long ebx;
|
|
|
|
long ecx;
|
|
|
|
long edx;
|
|
|
|
long esi;
|
|
|
|
long edi;
|
|
|
|
long ebp;
|
|
|
|
long eax;
|
|
|
|
int xds;
|
|
|
|
int xes;
|
|
|
|
long orig_eax;
|
|
|
|
long eip;
|
|
|
|
int xcs;
|
|
|
|
long eflags;
|
|
|
|
long esp;
|
|
|
|
int xss;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ioctls */
|
|
|
|
|
|
|
|
#define TARGET_LDT_ENTRIES 8192
|
|
|
|
#define TARGET_LDT_ENTRY_SIZE 8
|
|
|
|
|
2007-11-14 18:18:40 +03:00
|
|
|
#define TARGET_GDT_ENTRIES 9
|
2003-10-01 00:34:21 +04:00
|
|
|
#define TARGET_GDT_ENTRY_TLS_ENTRIES 3
|
|
|
|
#define TARGET_GDT_ENTRY_TLS_MIN 6
|
|
|
|
#define TARGET_GDT_ENTRY_TLS_MAX (TARGET_GDT_ENTRY_TLS_MIN + TARGET_GDT_ENTRY_TLS_ENTRIES - 1)
|
|
|
|
|
|
|
|
struct target_modify_ldt_ldt_s {
|
|
|
|
unsigned int entry_number;
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_ulong base_addr;
|
2003-10-01 00:34:21 +04:00
|
|
|
unsigned int limit;
|
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* vm86 defines */
|
|
|
|
|
|
|
|
#define TARGET_BIOSSEG 0x0f000
|
|
|
|
|
|
|
|
#define TARGET_CPU_086 0
|
|
|
|
#define TARGET_CPU_186 1
|
|
|
|
#define TARGET_CPU_286 2
|
|
|
|
#define TARGET_CPU_386 3
|
|
|
|
#define TARGET_CPU_486 4
|
|
|
|
#define TARGET_CPU_586 5
|
|
|
|
|
|
|
|
#define TARGET_VM86_SIGNAL 0 /* return due to signal */
|
|
|
|
#define TARGET_VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */
|
|
|
|
#define TARGET_VM86_INTx 2 /* int3/int x instruction (ARG = x) */
|
|
|
|
#define TARGET_VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Additional return values when invoking new vm86()
|
|
|
|
*/
|
|
|
|
#define TARGET_VM86_PICRETURN 4 /* return due to pending PIC request */
|
|
|
|
#define TARGET_VM86_TRAP 6 /* return due to DOS-debugger request */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* function codes when invoking new vm86()
|
|
|
|
*/
|
|
|
|
#define TARGET_VM86_PLUS_INSTALL_CHECK 0
|
|
|
|
#define TARGET_VM86_ENTER 1
|
|
|
|
#define TARGET_VM86_ENTER_NO_BYPASS 2
|
|
|
|
#define TARGET_VM86_REQUEST_IRQ 3
|
|
|
|
#define TARGET_VM86_FREE_IRQ 4
|
|
|
|
#define TARGET_VM86_GET_IRQ_BITS 5
|
|
|
|
#define TARGET_VM86_GET_AND_RESET_IRQ 6
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the stack-layout seen by the user space program when we have
|
|
|
|
* done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
|
|
|
|
* is 'kernel_vm86_regs' (see below).
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct target_vm86_regs {
|
|
|
|
/*
|
|
|
|
* normal regs, with special meaning for the segment descriptors..
|
|
|
|
*/
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_long ebx;
|
|
|
|
abi_long ecx;
|
|
|
|
abi_long edx;
|
|
|
|
abi_long esi;
|
|
|
|
abi_long edi;
|
|
|
|
abi_long ebp;
|
|
|
|
abi_long eax;
|
|
|
|
abi_long __null_ds;
|
|
|
|
abi_long __null_es;
|
|
|
|
abi_long __null_fs;
|
|
|
|
abi_long __null_gs;
|
|
|
|
abi_long orig_eax;
|
|
|
|
abi_long eip;
|
2003-10-01 00:34:21 +04:00
|
|
|
unsigned short cs, __csh;
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_long eflags;
|
|
|
|
abi_long esp;
|
2003-10-01 00:34:21 +04:00
|
|
|
unsigned short ss, __ssh;
|
|
|
|
/*
|
|
|
|
* these are specific to v86 mode:
|
|
|
|
*/
|
|
|
|
unsigned short es, __esh;
|
|
|
|
unsigned short ds, __dsh;
|
|
|
|
unsigned short fs, __fsh;
|
|
|
|
unsigned short gs, __gsh;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct target_revectored_struct {
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_ulong __map[8]; /* 256 bits */
|
2003-10-01 00:34:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct target_vm86_struct {
|
|
|
|
struct target_vm86_regs regs;
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_ulong flags;
|
|
|
|
abi_ulong screen_bitmap;
|
|
|
|
abi_ulong cpu_type;
|
2003-10-01 00:34:21 +04:00
|
|
|
struct target_revectored_struct int_revectored;
|
|
|
|
struct target_revectored_struct int21_revectored;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flags masks
|
|
|
|
*/
|
|
|
|
#define TARGET_VM86_SCREEN_BITMAP 0x0001
|
|
|
|
|
|
|
|
struct target_vm86plus_info_struct {
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_ulong flags;
|
2003-10-01 00:34:21 +04:00
|
|
|
#define TARGET_force_return_for_pic (1 << 0)
|
|
|
|
#define TARGET_vm86dbg_active (1 << 1) /* for debugger */
|
|
|
|
#define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */
|
|
|
|
#define TARGET_is_vm86pus (1 << 31) /* for vm86 internal use */
|
|
|
|
unsigned char vm86dbg_intxxtab[32]; /* for debugger */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct target_vm86plus_struct {
|
|
|
|
struct target_vm86_regs regs;
|
2007-10-14 20:27:31 +04:00
|
|
|
abi_ulong flags;
|
|
|
|
abi_ulong screen_bitmap;
|
|
|
|
abi_ulong cpu_type;
|
2003-10-01 00:34:21 +04:00
|
|
|
struct target_revectored_struct int_revectored;
|
|
|
|
struct target_revectored_struct int21_revectored;
|
|
|
|
struct target_vm86plus_info_struct vm86plus;
|
|
|
|
};
|
|
|
|
|
2004-09-14 01:41:39 +04:00
|
|
|
#define UNAME_MACHINE "i686"
|
2014-02-19 16:50:41 +04:00
|
|
|
#define UNAME_MINIMUM_RELEASE "2.6.32"
|
2013-07-16 21:44:57 +04:00
|
|
|
|
|
|
|
#define TARGET_CLONE_BACKWARDS
|
2020-08-11 19:45:51 +03:00
|
|
|
#define TARGET_MCL_CURRENT 1
|
|
|
|
#define TARGET_MCL_FUTURE 2
|
|
|
|
#define TARGET_MCL_ONFAULT 4
|
linux-user: fix TARGET_NR_select
TARGET_NR_select can have three different implementations:
1- to always return -ENOSYS
microblaze, ppc, ppc64
-> TARGET_WANT_NI_OLD_SELECT
2- to take parameters from a structure pointed by arg1
(kernel sys_old_select)
i386, arm, m68k
-> TARGET_WANT_OLD_SYS_SELECT
3- to take parameters from arg[1-5]
(kernel sys_select)
x86_64, alpha, s390x,
cris, sparc, sparc64
Some (new) architectures don't define NR_select,
4- but only NR__newselect with sys_select:
mips, mips64, sh
5- don't define NR__newselect, and use pselect6 syscall:
aarch64, openrisc, tilegx, unicore32
Reported-by: Timothy Pearson <tpearson@raptorengineering.com>
Reported-by: Allan Wirth <awirth@akamai.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-07-08 02:17:27 +03:00
|
|
|
#define TARGET_WANT_OLD_SYS_SELECT
|
2016-02-01 21:38:42 +03:00
|
|
|
|
2016-06-29 11:47:26 +03:00
|
|
|
#endif /* I386_TARGET_SYSCALL_H */
|