target_syscall.h (3758B)
1/* 2 * x86_64 system call definitions 3 * 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 */ 18#ifndef TARGET_SYSCALL_H 19#define TARGET_SYSCALL_H 20 21#define __USER_CS (0x33) 22#define __USER_DS (0x2B) 23 24struct target_pt_regs { 25 abi_ulong r15; 26 abi_ulong r14; 27 abi_ulong r13; 28 abi_ulong r12; 29 abi_ulong rbp; 30 abi_ulong rbx; 31/* arguments: non interrupts/non tracing syscalls only save up to here */ 32 abi_ulong r11; 33 abi_ulong r10; 34 abi_ulong r9; 35 abi_ulong r8; 36 abi_ulong rax; 37 abi_ulong rcx; 38 abi_ulong rdx; 39 abi_ulong rsi; 40 abi_ulong rdi; 41 abi_ulong orig_rax; 42/* end of arguments */ 43/* cpu exception frame or undefined */ 44 abi_ulong rip; 45 abi_ulong cs; 46 abi_ulong eflags; 47 abi_ulong rsp; 48 abi_ulong ss; 49/* top of stack page */ 50}; 51 52/* Maximum number of LDT entries supported. */ 53#define TARGET_LDT_ENTRIES 8192 54/* The size of each LDT entry. */ 55#define TARGET_LDT_ENTRY_SIZE 8 56 57#define TARGET_GDT_ENTRIES 16 58#define TARGET_GDT_ENTRY_TLS_ENTRIES 3 59#define TARGET_GDT_ENTRY_TLS_MIN 12 60#define TARGET_GDT_ENTRY_TLS_MAX 14 61 62#if 0 // Redefine this 63struct target_modify_ldt_ldt_s { 64 unsigned int entry_number; 65 abi_ulong base_addr; 66 unsigned int limit; 67 unsigned int seg_32bit:1; 68 unsigned int contents:2; 69 unsigned int read_exec_only:1; 70 unsigned int limit_in_pages:1; 71 unsigned int seg_not_present:1; 72 unsigned int useable:1; 73 unsigned int lm:1; 74}; 75#else 76struct target_modify_ldt_ldt_s { 77 unsigned int entry_number; 78 abi_ulong base_addr; 79 unsigned int limit; 80 unsigned int flags; 81}; 82#endif 83 84struct target_ipc64_perm 85{ 86 int key; 87 uint32_t uid; 88 uint32_t gid; 89 uint32_t cuid; 90 uint32_t cgid; 91 unsigned short mode; 92 unsigned short __pad1; 93 unsigned short seq; 94 unsigned short __pad2; 95 abi_ulong __unused1; 96 abi_ulong __unused2; 97}; 98 99struct target_msqid64_ds { 100 struct target_ipc64_perm msg_perm; 101 unsigned int msg_stime; /* last msgsnd time */ 102 unsigned int msg_rtime; /* last msgrcv time */ 103 unsigned int msg_ctime; /* last change time */ 104 abi_ulong msg_cbytes; /* current number of bytes on queue */ 105 abi_ulong msg_qnum; /* number of messages in queue */ 106 abi_ulong msg_qbytes; /* max number of bytes on queue */ 107 unsigned int msg_lspid; /* pid of last msgsnd */ 108 unsigned int msg_lrpid; /* last receive pid */ 109 abi_ulong __unused4; 110 abi_ulong __unused5; 111}; 112 113/* FreeBSD sysarch(2) */ 114#define TARGET_FREEBSD_I386_GET_LDT 0 115#define TARGET_FREEBSD_I386_SET_LDT 1 116 /* I386_IOPL */ 117#define TARGET_FREEBSD_I386_GET_IOPERM 3 118#define TARGET_FREEBSD_I386_SET_IOPERM 4 119 /* xxxxx */ 120#define TARGET_FREEBSD_I386_GET_FSBASE 7 121#define TARGET_FREEBSD_I386_SET_FSBASE 8 122#define TARGET_FREEBSD_I386_GET_GSBASE 9 123#define TARGET_FREEBSD_I386_SET_GSBASE 10 124 125#define TARGET_FREEBSD_AMD64_GET_FSBASE 128 126#define TARGET_FREEBSD_AMD64_SET_FSBASE 129 127#define TARGET_FREEBSD_AMD64_GET_GSBASE 130 128#define TARGET_FREEBSD_AMD64_SET_GSBASE 131 129 130 131#define UNAME_MACHINE "x86_64" 132#define TARGET_HW_MACHINE "amd64" 133#define TARGET_HW_MACHINE_ARCH "amd64" 134 135#define TARGET_ARCH_SET_GS 0x1001 136#define TARGET_ARCH_SET_FS 0x1002 137#define TARGET_ARCH_GET_FS 0x1003 138#define TARGET_ARCH_GET_GS 0x1004 139 140#endif /* TARGET_SYSCALL_H */