2 * x86_64 system call definitions
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.
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.
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/>.
18 #ifndef TARGET_SYSCALL_H
19 #define TARGET_SYSCALL_H
21 #define __USER_CS (0x33)
22 #define __USER_DS (0x2B)
24 struct target_pt_regs
{
31 /* arguments: non interrupts/non tracing syscalls only save up to here */
42 /* end of arguments */
43 /* cpu exception frame or undefined */
49 /* top of stack page */
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
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
62 #if 0 // Redefine this
63 struct target_modify_ldt_ldt_s
{
64 unsigned int entry_number
;
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;
76 struct target_modify_ldt_ldt_s
{
77 unsigned int entry_number
;
84 struct target_ipc64_perm
92 unsigned short __pad1
;
94 unsigned short __pad2
;
99 struct 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 */
113 /* FreeBSD sysarch(2) */
114 #define TARGET_FREEBSD_I386_GET_LDT 0
115 #define TARGET_FREEBSD_I386_SET_LDT 1
117 #define TARGET_FREEBSD_I386_GET_IOPERM 3
118 #define TARGET_FREEBSD_I386_SET_IOPERM 4
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
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
131 #define UNAME_MACHINE "x86_64"
132 #define TARGET_HW_MACHINE "amd64"
133 #define TARGET_HW_MACHINE_ARCH "amd64"
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
140 #endif /* TARGET_SYSCALL_H */