1 |
330 |
jeremybenn |
/* Target-dependent code for GNU/Linux AMD64.
|
2 |
|
|
|
3 |
|
|
Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
This file is part of GDB.
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 3 of the License, or
|
10 |
|
|
(at your option) any later version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
19 |
|
|
|
20 |
|
|
#ifndef AMD64_LINUX_TDEP_H
|
21 |
|
|
#define AMD64_LINUX_TDEP_H
|
22 |
|
|
|
23 |
|
|
/* Like for i386 GNU/Linux, there is an extra "register"
|
24 |
|
|
used to control syscall restarting. */
|
25 |
|
|
|
26 |
|
|
/* Register number for the "orig_rax" register. If this register
|
27 |
|
|
contains a value >= 0 it is interpreted as the system call number
|
28 |
|
|
that the kernel is supposed to restart. */
|
29 |
|
|
#define AMD64_LINUX_ORIG_RAX_REGNUM (AMD64_YMM15H_REGNUM + 1)
|
30 |
|
|
|
31 |
|
|
/* Total number of registers for GNU/Linux. */
|
32 |
|
|
#define AMD64_LINUX_NUM_REGS (AMD64_LINUX_ORIG_RAX_REGNUM + 1)
|
33 |
|
|
|
34 |
|
|
/* Linux target description. */
|
35 |
|
|
extern struct target_desc *tdesc_amd64_linux;
|
36 |
|
|
extern struct target_desc *tdesc_amd64_avx_linux;
|
37 |
|
|
|
38 |
|
|
/* Enum that defines the syscall identifiers for amd64 linux.
|
39 |
|
|
Used for process record/replay, these will be translated into
|
40 |
|
|
a gdb-canonical set of syscall ids in linux-record.c. */
|
41 |
|
|
|
42 |
|
|
enum amd64_syscall {
|
43 |
|
|
amd64_sys_read = 0,
|
44 |
|
|
amd64_sys_write = 1,
|
45 |
|
|
amd64_sys_open = 2,
|
46 |
|
|
amd64_sys_close = 3,
|
47 |
|
|
amd64_sys_newstat = 4,
|
48 |
|
|
amd64_sys_newfstat = 5,
|
49 |
|
|
amd64_sys_newlstat = 6,
|
50 |
|
|
amd64_sys_poll = 7,
|
51 |
|
|
amd64_sys_lseek = 8,
|
52 |
|
|
amd64_sys_mmap = 9,
|
53 |
|
|
amd64_sys_mprotect = 10,
|
54 |
|
|
amd64_sys_munmap = 11,
|
55 |
|
|
amd64_sys_brk = 12,
|
56 |
|
|
amd64_sys_rt_sigaction = 13,
|
57 |
|
|
amd64_sys_rt_sigprocmask = 14,
|
58 |
|
|
amd64_sys_rt_sigreturn = 15,
|
59 |
|
|
amd64_sys_ioctl = 16,
|
60 |
|
|
amd64_sys_pread64 = 17,
|
61 |
|
|
amd64_sys_pwrite64 = 18,
|
62 |
|
|
amd64_sys_readv = 19,
|
63 |
|
|
amd64_sys_writev = 20,
|
64 |
|
|
amd64_sys_access = 21,
|
65 |
|
|
amd64_sys_pipe = 22,
|
66 |
|
|
amd64_sys_select = 23,
|
67 |
|
|
amd64_sys_sched_yield = 24,
|
68 |
|
|
amd64_sys_mremap = 25,
|
69 |
|
|
amd64_sys_msync = 26,
|
70 |
|
|
amd64_sys_mincore = 27,
|
71 |
|
|
amd64_sys_madvise = 28,
|
72 |
|
|
amd64_sys_shmget = 29,
|
73 |
|
|
amd64_sys_shmat = 30,
|
74 |
|
|
amd64_sys_shmctl = 31,
|
75 |
|
|
amd64_sys_dup = 32,
|
76 |
|
|
amd64_sys_dup2 = 33,
|
77 |
|
|
amd64_sys_pause = 34,
|
78 |
|
|
amd64_sys_nanosleep = 35,
|
79 |
|
|
amd64_sys_getitimer = 36,
|
80 |
|
|
amd64_sys_alarm = 37,
|
81 |
|
|
amd64_sys_setitimer = 38,
|
82 |
|
|
amd64_sys_getpid = 39,
|
83 |
|
|
amd64_sys_sendfile64 = 40,
|
84 |
|
|
amd64_sys_socket = 41,
|
85 |
|
|
amd64_sys_connect = 42,
|
86 |
|
|
amd64_sys_accept = 43,
|
87 |
|
|
amd64_sys_sendto = 44,
|
88 |
|
|
amd64_sys_recvfrom = 45,
|
89 |
|
|
amd64_sys_sendmsg = 46,
|
90 |
|
|
amd64_sys_recvmsg = 47,
|
91 |
|
|
amd64_sys_shutdown = 48,
|
92 |
|
|
amd64_sys_bind = 49,
|
93 |
|
|
amd64_sys_listen = 50,
|
94 |
|
|
amd64_sys_getsockname = 51,
|
95 |
|
|
amd64_sys_getpeername = 52,
|
96 |
|
|
amd64_sys_socketpair = 53,
|
97 |
|
|
amd64_sys_setsockopt = 54,
|
98 |
|
|
amd64_sys_getsockopt = 55,
|
99 |
|
|
amd64_sys_clone = 56,
|
100 |
|
|
amd64_sys_fork = 57,
|
101 |
|
|
amd64_sys_vfork = 58,
|
102 |
|
|
amd64_sys_execve = 59,
|
103 |
|
|
amd64_sys_exit = 60,
|
104 |
|
|
amd64_sys_wait4 = 61,
|
105 |
|
|
amd64_sys_kill = 62,
|
106 |
|
|
amd64_sys_uname = 63,
|
107 |
|
|
amd64_sys_semget = 64,
|
108 |
|
|
amd64_sys_semop = 65,
|
109 |
|
|
amd64_sys_semctl = 66,
|
110 |
|
|
amd64_sys_shmdt = 67,
|
111 |
|
|
amd64_sys_msgget = 68,
|
112 |
|
|
amd64_sys_msgsnd = 69,
|
113 |
|
|
amd64_sys_msgrcv = 70,
|
114 |
|
|
amd64_sys_msgctl = 71,
|
115 |
|
|
amd64_sys_fcntl = 72,
|
116 |
|
|
amd64_sys_flock = 73,
|
117 |
|
|
amd64_sys_fsync = 74,
|
118 |
|
|
amd64_sys_fdatasync = 75,
|
119 |
|
|
amd64_sys_truncate = 76,
|
120 |
|
|
amd64_sys_ftruncate = 77,
|
121 |
|
|
amd64_sys_getdents = 78,
|
122 |
|
|
amd64_sys_getcwd = 79,
|
123 |
|
|
amd64_sys_chdir = 80,
|
124 |
|
|
amd64_sys_fchdir = 81,
|
125 |
|
|
amd64_sys_rename = 82,
|
126 |
|
|
amd64_sys_mkdir = 83,
|
127 |
|
|
amd64_sys_rmdir = 84,
|
128 |
|
|
amd64_sys_creat = 85,
|
129 |
|
|
amd64_sys_link = 86,
|
130 |
|
|
amd64_sys_unlink = 87,
|
131 |
|
|
amd64_sys_symlink = 88,
|
132 |
|
|
amd64_sys_readlink = 89,
|
133 |
|
|
amd64_sys_chmod = 90,
|
134 |
|
|
amd64_sys_fchmod = 91,
|
135 |
|
|
amd64_sys_chown = 92,
|
136 |
|
|
amd64_sys_fchown = 93,
|
137 |
|
|
amd64_sys_lchown = 94,
|
138 |
|
|
amd64_sys_umask = 95,
|
139 |
|
|
amd64_sys_gettimeofday = 96,
|
140 |
|
|
amd64_sys_getrlimit = 97,
|
141 |
|
|
amd64_sys_getrusage = 98,
|
142 |
|
|
amd64_sys_sysinfo = 99,
|
143 |
|
|
amd64_sys_times = 100,
|
144 |
|
|
amd64_sys_ptrace = 101,
|
145 |
|
|
amd64_sys_getuid = 102,
|
146 |
|
|
amd64_sys_syslog = 103,
|
147 |
|
|
amd64_sys_getgid = 104,
|
148 |
|
|
amd64_sys_setuid = 105,
|
149 |
|
|
amd64_sys_setgid = 106,
|
150 |
|
|
amd64_sys_geteuid = 107,
|
151 |
|
|
amd64_sys_getegid = 108,
|
152 |
|
|
amd64_sys_setpgid = 109,
|
153 |
|
|
amd64_sys_getppid = 110,
|
154 |
|
|
amd64_sys_getpgrp = 111,
|
155 |
|
|
amd64_sys_setsid = 112,
|
156 |
|
|
amd64_sys_setreuid = 113,
|
157 |
|
|
amd64_sys_setregid = 114,
|
158 |
|
|
amd64_sys_getgroups = 115,
|
159 |
|
|
amd64_sys_setgroups = 116,
|
160 |
|
|
amd64_sys_setresuid = 117,
|
161 |
|
|
amd64_sys_getresuid = 118,
|
162 |
|
|
amd64_sys_setresgid = 119,
|
163 |
|
|
amd64_sys_getresgid = 120,
|
164 |
|
|
amd64_sys_getpgid = 121,
|
165 |
|
|
amd64_sys_setfsuid = 122,
|
166 |
|
|
amd64_sys_setfsgid = 123,
|
167 |
|
|
amd64_sys_getsid = 124,
|
168 |
|
|
amd64_sys_capget = 125,
|
169 |
|
|
amd64_sys_capset = 126,
|
170 |
|
|
amd64_sys_rt_sigpending = 127,
|
171 |
|
|
amd64_sys_rt_sigtimedwait = 128,
|
172 |
|
|
amd64_sys_rt_sigqueueinfo = 129,
|
173 |
|
|
amd64_sys_rt_sigsuspend = 130,
|
174 |
|
|
amd64_sys_sigaltstack = 131,
|
175 |
|
|
amd64_sys_utime = 132,
|
176 |
|
|
amd64_sys_mknod = 133,
|
177 |
|
|
amd64_sys_personality = 135,
|
178 |
|
|
amd64_sys_ustat = 136,
|
179 |
|
|
amd64_sys_statfs = 137,
|
180 |
|
|
amd64_sys_fstatfs = 138,
|
181 |
|
|
amd64_sys_sysfs = 139,
|
182 |
|
|
amd64_sys_getpriority = 140,
|
183 |
|
|
amd64_sys_setpriority = 141,
|
184 |
|
|
amd64_sys_sched_setparam = 142,
|
185 |
|
|
amd64_sys_sched_getparam = 143,
|
186 |
|
|
amd64_sys_sched_setscheduler = 144,
|
187 |
|
|
amd64_sys_sched_getscheduler = 145,
|
188 |
|
|
amd64_sys_sched_get_priority_max = 146,
|
189 |
|
|
amd64_sys_sched_get_priority_min = 147,
|
190 |
|
|
amd64_sys_sched_rr_get_interval = 148,
|
191 |
|
|
amd64_sys_mlock = 149,
|
192 |
|
|
amd64_sys_munlock = 150,
|
193 |
|
|
amd64_sys_mlockall = 151,
|
194 |
|
|
amd64_sys_munlockall = 152,
|
195 |
|
|
amd64_sys_vhangup = 153,
|
196 |
|
|
amd64_sys_modify_ldt = 154,
|
197 |
|
|
amd64_sys_pivot_root = 155,
|
198 |
|
|
amd64_sys_sysctl = 156,
|
199 |
|
|
amd64_sys_prctl = 157,
|
200 |
|
|
amd64_sys_arch_prctl = 158,
|
201 |
|
|
amd64_sys_adjtimex = 159,
|
202 |
|
|
amd64_sys_setrlimit = 160,
|
203 |
|
|
amd64_sys_chroot = 161,
|
204 |
|
|
amd64_sys_sync = 162,
|
205 |
|
|
amd64_sys_acct = 163,
|
206 |
|
|
amd64_sys_settimeofday = 164,
|
207 |
|
|
amd64_sys_mount = 165,
|
208 |
|
|
amd64_sys_umount = 166,
|
209 |
|
|
amd64_sys_swapon = 167,
|
210 |
|
|
amd64_sys_swapoff = 168,
|
211 |
|
|
amd64_sys_reboot = 169,
|
212 |
|
|
amd64_sys_sethostname = 170,
|
213 |
|
|
amd64_sys_setdomainname = 171,
|
214 |
|
|
amd64_sys_iopl = 172,
|
215 |
|
|
amd64_sys_ioperm = 173,
|
216 |
|
|
amd64_sys_init_module = 175,
|
217 |
|
|
amd64_sys_delete_module = 176,
|
218 |
|
|
amd64_sys_quotactl = 179,
|
219 |
|
|
amd64_sys_nfsservctl = 180,
|
220 |
|
|
amd64_sys_gettid = 186,
|
221 |
|
|
amd64_sys_readahead = 187,
|
222 |
|
|
amd64_sys_setxattr = 188,
|
223 |
|
|
amd64_sys_lsetxattr = 189,
|
224 |
|
|
amd64_sys_fsetxattr = 190,
|
225 |
|
|
amd64_sys_getxattr = 191,
|
226 |
|
|
amd64_sys_lgetxattr = 192,
|
227 |
|
|
amd64_sys_fgetxattr = 193,
|
228 |
|
|
amd64_sys_listxattr = 194,
|
229 |
|
|
amd64_sys_llistxattr = 195,
|
230 |
|
|
amd64_sys_flistxattr = 196,
|
231 |
|
|
amd64_sys_removexattr = 197,
|
232 |
|
|
amd64_sys_lremovexattr = 198,
|
233 |
|
|
amd64_sys_fremovexattr = 199,
|
234 |
|
|
amd64_sys_tkill = 200,
|
235 |
|
|
amd64_sys_time = 201,
|
236 |
|
|
amd64_sys_futex = 202,
|
237 |
|
|
amd64_sys_sched_setaffinity = 203,
|
238 |
|
|
amd64_sys_sched_getaffinity = 204,
|
239 |
|
|
amd64_sys_io_setup = 206,
|
240 |
|
|
amd64_sys_io_destroy = 207,
|
241 |
|
|
amd64_sys_io_getevents = 208,
|
242 |
|
|
amd64_sys_io_submit = 209,
|
243 |
|
|
amd64_sys_io_cancel = 210,
|
244 |
|
|
amd64_sys_lookup_dcookie = 212,
|
245 |
|
|
amd64_sys_epoll_create = 213,
|
246 |
|
|
amd64_sys_remap_file_pages = 216,
|
247 |
|
|
amd64_sys_getdents64 = 217,
|
248 |
|
|
amd64_sys_set_tid_address = 218,
|
249 |
|
|
amd64_sys_restart_syscall = 219,
|
250 |
|
|
amd64_sys_semtimedop = 220,
|
251 |
|
|
amd64_sys_fadvise64 = 221,
|
252 |
|
|
amd64_sys_timer_create = 222,
|
253 |
|
|
amd64_sys_timer_settime = 223,
|
254 |
|
|
amd64_sys_timer_gettime = 224,
|
255 |
|
|
amd64_sys_timer_getoverrun = 225,
|
256 |
|
|
amd64_sys_timer_delete = 226,
|
257 |
|
|
amd64_sys_clock_settime = 227,
|
258 |
|
|
amd64_sys_clock_gettime = 228,
|
259 |
|
|
amd64_sys_clock_getres = 229,
|
260 |
|
|
amd64_sys_clock_nanosleep = 230,
|
261 |
|
|
amd64_sys_exit_group = 231,
|
262 |
|
|
amd64_sys_epoll_wait = 232,
|
263 |
|
|
amd64_sys_epoll_ctl = 233,
|
264 |
|
|
amd64_sys_tgkill = 234,
|
265 |
|
|
amd64_sys_utimes = 235,
|
266 |
|
|
amd64_sys_mbind = 237,
|
267 |
|
|
amd64_sys_set_mempolicy = 238,
|
268 |
|
|
amd64_sys_get_mempolicy = 239,
|
269 |
|
|
amd64_sys_mq_open = 240,
|
270 |
|
|
amd64_sys_mq_unlink = 241,
|
271 |
|
|
amd64_sys_mq_timedsend = 242,
|
272 |
|
|
amd64_sys_mq_timedreceive = 243,
|
273 |
|
|
amd64_sys_mq_notify = 244,
|
274 |
|
|
amd64_sys_mq_getsetattr = 245,
|
275 |
|
|
amd64_sys_kexec_load = 246,
|
276 |
|
|
amd64_sys_waitid = 247,
|
277 |
|
|
amd64_sys_add_key = 248,
|
278 |
|
|
amd64_sys_request_key = 249,
|
279 |
|
|
amd64_sys_keyctl = 250,
|
280 |
|
|
amd64_sys_ioprio_set = 251,
|
281 |
|
|
amd64_sys_ioprio_get = 252,
|
282 |
|
|
amd64_sys_inotify_init = 253,
|
283 |
|
|
amd64_sys_inotify_add_watch = 254,
|
284 |
|
|
amd64_sys_inotify_rm_watch = 255,
|
285 |
|
|
amd64_sys_migrate_pages = 256,
|
286 |
|
|
amd64_sys_openat = 257,
|
287 |
|
|
amd64_sys_mkdirat = 258,
|
288 |
|
|
amd64_sys_mknodat = 259,
|
289 |
|
|
amd64_sys_fchownat = 260,
|
290 |
|
|
amd64_sys_futimesat = 261,
|
291 |
|
|
amd64_sys_newfstatat = 262,
|
292 |
|
|
amd64_sys_unlinkat = 263,
|
293 |
|
|
amd64_sys_renameat = 264,
|
294 |
|
|
amd64_sys_linkat = 265,
|
295 |
|
|
amd64_sys_symlinkat = 266,
|
296 |
|
|
amd64_sys_readlinkat = 267,
|
297 |
|
|
amd64_sys_fchmodat = 268,
|
298 |
|
|
amd64_sys_faccessat = 269,
|
299 |
|
|
amd64_sys_pselect6 = 270,
|
300 |
|
|
amd64_sys_ppoll = 271,
|
301 |
|
|
amd64_sys_unshare = 272,
|
302 |
|
|
amd64_sys_set_robust_list = 273,
|
303 |
|
|
amd64_sys_get_robust_list = 274,
|
304 |
|
|
amd64_sys_splice = 275,
|
305 |
|
|
amd64_sys_tee = 276,
|
306 |
|
|
amd64_sys_sync_file_range = 277,
|
307 |
|
|
amd64_sys_vmsplice = 278,
|
308 |
|
|
amd64_sys_move_pages = 279,
|
309 |
|
|
};
|
310 |
|
|
|
311 |
|
|
#endif /* amd64-linux-tdep.h */
|