Markus Armbruster | 3622634 | 2016-06-29 10:47:26 +0200 | [diff] [blame] | 1 | #ifndef X86_64_TARGET_SYSCALL_H |
| 2 | #define X86_64_TARGET_SYSCALL_H |
Lluís Vilanova | 460c579 | 2016-02-01 19:38:42 +0100 | [diff] [blame] | 3 | |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 4 | #define __USER_CS (0x33) |
| 5 | #define __USER_DS (0x2B) |
| 6 | |
| 7 | struct target_pt_regs { |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 8 | abi_ulong r15; |
| 9 | abi_ulong r14; |
| 10 | abi_ulong r13; |
| 11 | abi_ulong r12; |
| 12 | abi_ulong rbp; |
| 13 | abi_ulong rbx; |
Stefan Weil | e7d8100 | 2011-12-10 00:19:46 +0100 | [diff] [blame] | 14 | /* arguments: non interrupts/non tracing syscalls only save up to here */ |
Paolo Bonzini | 72e21db | 2018-12-13 23:37:36 +0100 | [diff] [blame] | 15 | abi_ulong r11; |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 16 | abi_ulong r10; |
| 17 | abi_ulong r9; |
| 18 | abi_ulong r8; |
| 19 | abi_ulong rax; |
| 20 | abi_ulong rcx; |
| 21 | abi_ulong rdx; |
| 22 | abi_ulong rsi; |
| 23 | abi_ulong rdi; |
| 24 | abi_ulong orig_rax; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 25 | /* end of arguments */ |
| 26 | /* cpu exception frame or undefined */ |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 27 | abi_ulong rip; |
| 28 | abi_ulong cs; |
| 29 | abi_ulong eflags; |
| 30 | abi_ulong rsp; |
| 31 | abi_ulong ss; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 32 | /* top of stack page */ |
| 33 | }; |
| 34 | |
| 35 | /* Maximum number of LDT entries supported. */ |
| 36 | #define TARGET_LDT_ENTRIES 8192 |
| 37 | /* The size of each LDT entry. */ |
| 38 | #define TARGET_LDT_ENTRY_SIZE 8 |
| 39 | |
bellard | 8d18e89 | 2007-11-14 15:18:40 +0000 | [diff] [blame] | 40 | #define TARGET_GDT_ENTRIES 16 |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 41 | #define TARGET_GDT_ENTRY_TLS_ENTRIES 3 |
| 42 | #define TARGET_GDT_ENTRY_TLS_MIN 12 |
| 43 | #define TARGET_GDT_ENTRY_TLS_MAX 14 |
| 44 | |
| 45 | #if 0 // Redefine this |
| 46 | struct target_modify_ldt_ldt_s { |
| 47 | unsigned int entry_number; |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 48 | abi_ulong base_addr; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 49 | unsigned int limit; |
| 50 | unsigned int seg_32bit:1; |
| 51 | unsigned int contents:2; |
| 52 | unsigned int read_exec_only:1; |
| 53 | unsigned int limit_in_pages:1; |
| 54 | unsigned int seg_not_present:1; |
| 55 | unsigned int useable:1; |
| 56 | unsigned int lm:1; |
| 57 | }; |
| 58 | #else |
| 59 | struct target_modify_ldt_ldt_s { |
| 60 | unsigned int entry_number; |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 61 | abi_ulong base_addr; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 62 | unsigned int limit; |
| 63 | unsigned int flags; |
| 64 | }; |
| 65 | #endif |
| 66 | |
| 67 | struct target_ipc64_perm |
| 68 | { |
| 69 | int key; |
| 70 | uint32_t uid; |
| 71 | uint32_t gid; |
| 72 | uint32_t cuid; |
| 73 | uint32_t cgid; |
| 74 | unsigned short mode; |
| 75 | unsigned short __pad1; |
| 76 | unsigned short seq; |
| 77 | unsigned short __pad2; |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 78 | abi_ulong __unused1; |
| 79 | abi_ulong __unused2; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | struct target_msqid64_ds { |
| 83 | struct target_ipc64_perm msg_perm; |
| 84 | unsigned int msg_stime; /* last msgsnd time */ |
| 85 | unsigned int msg_rtime; /* last msgrcv time */ |
| 86 | unsigned int msg_ctime; /* last change time */ |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 87 | abi_ulong msg_cbytes; /* current number of bytes on queue */ |
| 88 | abi_ulong msg_qnum; /* number of messages in queue */ |
| 89 | abi_ulong msg_qbytes; /* max number of bytes on queue */ |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 90 | unsigned int msg_lspid; /* pid of last msgsnd */ |
| 91 | unsigned int msg_lrpid; /* last receive pid */ |
blueswir1 | 992f48a | 2007-10-14 16:27:31 +0000 | [diff] [blame] | 92 | abi_ulong __unused4; |
| 93 | abi_ulong __unused5; |
j_mayer | 74aa042 | 2007-04-06 06:40:51 +0000 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | #define UNAME_MACHINE "x86_64" |
Riku Voipio | cbc14e6 | 2014-02-19 14:50:41 +0200 | [diff] [blame] | 97 | #define UNAME_MINIMUM_RELEASE "2.6.32" |
bellard | d2fd1af | 2007-11-14 18:08:56 +0000 | [diff] [blame] | 98 | |
| 99 | #define TARGET_ARCH_SET_GS 0x1001 |
| 100 | #define TARGET_ARCH_SET_FS 0x1002 |
| 101 | #define TARGET_ARCH_GET_FS 0x1003 |
| 102 | #define TARGET_ARCH_GET_GS 0x1004 |
Filip Bozuta | 02e5d7d | 2020-08-11 18:45:51 +0200 | [diff] [blame] | 103 | #define TARGET_MCL_CURRENT 1 |
| 104 | #define TARGET_MCL_FUTURE 2 |
| 105 | #define TARGET_MCL_ONFAULT 4 |
Lluís Vilanova | 460c579 | 2016-02-01 19:38:42 +0100 | [diff] [blame] | 106 | |
Markus Armbruster | 3622634 | 2016-06-29 10:47:26 +0200 | [diff] [blame] | 107 | #endif /* X86_64_TARGET_SYSCALL_H */ |