ab82ce0f08689bda79b9558418c146241dbd01fa
[qemu] / linux-user / x86_64 / syscall.h
1 #define __USER_CS       (0x33)
2 #define __USER_DS       (0x2B)
3
4 struct target_pt_regs {
5     abi_ulong r15;
6     abi_ulong r14;
7     abi_ulong r13;
8     abi_ulong r12;
9     abi_ulong rbp;
10     abi_ulong rbx;
11 /* arguments: non interrupts/non tracing syscalls only save upto here*/
12     abi_ulong r11;
13     abi_ulong r10;
14     abi_ulong r9;
15     abi_ulong r8;
16     abi_ulong rax;
17     abi_ulong rcx;
18     abi_ulong rdx;
19     abi_ulong rsi;
20     abi_ulong rdi;
21     abi_ulong orig_rax;
22 /* end of arguments */
23 /* cpu exception frame or undefined */
24     abi_ulong rip;
25     abi_ulong cs;
26     abi_ulong eflags;
27     abi_ulong rsp;
28     abi_ulong ss;
29     abi_ulong fs_base;
30     abi_ulong gs_base;
31     abi_ulong ds;
32     abi_ulong es;
33     abi_ulong fs;
34     abi_ulong gs;
35 /* top of stack page */
36 };
37
38 /* Maximum number of LDT entries supported. */
39 #define TARGET_LDT_ENTRIES      8192
40 /* The size of each LDT entry. */
41 #define TARGET_LDT_ENTRY_SIZE   8
42
43 #define TARGET_GDT_ENTRIES 16
44 #define TARGET_GDT_ENTRY_TLS_ENTRIES 3
45 #define TARGET_GDT_ENTRY_TLS_MIN 12
46 #define TARGET_GDT_ENTRY_TLS_MAX 14
47
48 #if 0 // Redefine this
49 struct target_modify_ldt_ldt_s {
50         unsigned int  entry_number;
51         abi_ulong     base_addr;
52         unsigned int  limit;
53         unsigned int  seg_32bit:1;
54         unsigned int  contents:2;
55         unsigned int  read_exec_only:1;
56         unsigned int  limit_in_pages:1;
57         unsigned int  seg_not_present:1;
58         unsigned int  useable:1;
59         unsigned int  lm:1;
60 };
61 #else
62 struct target_modify_ldt_ldt_s {
63         unsigned int  entry_number;
64         abi_ulong     base_addr;
65         unsigned int  limit;
66         unsigned int flags;
67 };
68 #endif
69
70 struct target_ipc64_perm
71 {
72         int             key;
73         uint32_t        uid;
74         uint32_t        gid;
75         uint32_t        cuid;
76         uint32_t        cgid;
77         unsigned short          mode;
78         unsigned short          __pad1;
79         unsigned short          seq;
80         unsigned short          __pad2;
81         abi_ulong               __unused1;
82         abi_ulong               __unused2;
83 };
84
85 struct target_msqid64_ds {
86         struct target_ipc64_perm msg_perm;
87         unsigned int msg_stime; /* last msgsnd time */
88         unsigned int msg_rtime; /* last msgrcv time */
89         unsigned int msg_ctime; /* last change time */
90         abi_ulong  msg_cbytes;  /* current number of bytes on queue */
91         abi_ulong  msg_qnum;    /* number of messages in queue */
92         abi_ulong  msg_qbytes;  /* max number of bytes on queue */
93         unsigned int msg_lspid; /* pid of last msgsnd */
94         unsigned int msg_lrpid; /* last receive pid */
95         abi_ulong  __unused4;
96         abi_ulong  __unused5;
97 };
98
99 #define UNAME_MACHINE "x86_64"
100
101 #define TARGET_ARCH_SET_GS 0x1001
102 #define TARGET_ARCH_SET_FS 0x1002
103 #define TARGET_ARCH_GET_FS 0x1003
104 #define TARGET_ARCH_GET_GS 0x1004