process.cc revision 6231:8130f3faa584
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Authors: Korey Sewell
30 *          Stephen Hines
31 */
32
33#include "arch/arm/linux/linux.hh"
34#include "arch/arm/linux/process.hh"
35#include "arch/arm/isa_traits.hh"
36
37#include "base/trace.hh"
38#include "cpu/thread_context.hh"
39#include "kern/linux/linux.hh"
40
41#include "sim/process.hh"
42#include "sim/syscall_emul.hh"
43
44using namespace std;
45using namespace ArmISA;
46
47/// Target uname() handler.
48static SyscallReturn
49unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
50          ThreadContext *tc)
51{
52    TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, 0));
53
54    strcpy(name->sysname, "Linux");
55    strcpy(name->nodename, "m5.eecs.umich.edu");
56    strcpy(name->release, "2.6.16.19");
57    strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
58    strcpy(name->machine, "arm");
59
60    name.copyOut(tc->getMemPort());
61    return 0;
62}
63
64SyscallDesc ArmLinuxProcess::syscallDescs[] = {
65    /*  0 */ SyscallDesc("syscall", unimplementedFunc),
66    /*  1 */ SyscallDesc("exit", exitFunc),
67    /*  2 */ SyscallDesc("fork", unimplementedFunc),
68    /*  3 */ SyscallDesc("read", readFunc),
69    /*  4 */ SyscallDesc("write", writeFunc),
70    /*  5 */ SyscallDesc("open", openFunc<ArmLinux>),
71    /*  6 */ SyscallDesc("close", closeFunc),
72    /*  7 */ SyscallDesc("waitpid", unimplementedFunc), //???
73    /*  8 */ SyscallDesc("creat", unimplementedFunc),
74    /*  9 */ SyscallDesc("link", unimplementedFunc),
75    /* 10 */ SyscallDesc("unlink", unlinkFunc),
76    /* 11 */ SyscallDesc("execve", unimplementedFunc),
77    /* 12 */ SyscallDesc("chdir", unimplementedFunc),
78    /* 13 */ SyscallDesc("time", unimplementedFunc),
79    /* 14 */ SyscallDesc("mknod", unimplementedFunc),
80    /* 15 */ SyscallDesc("chmod", chmodFunc<ArmLinux>),
81    /* 16 */ SyscallDesc("lchown", chownFunc),
82    /* 17 */ SyscallDesc("break", brkFunc), //???
83    /* 18 */ SyscallDesc("unused#18", unimplementedFunc), //???
84    /* 19 */ SyscallDesc("lseek", lseekFunc),
85    /* 20 */ SyscallDesc("getpid", getpidFunc),
86    /* 21 */ SyscallDesc("mount", unimplementedFunc),
87    /* 22 */ SyscallDesc("umount", unimplementedFunc),
88    /* 23 */ SyscallDesc("setuid", setuidFunc),
89    /* 24 */ SyscallDesc("getuid", getuidFunc),
90    /* 25 */ SyscallDesc("stime", unimplementedFunc),
91    /* 26 */ SyscallDesc("ptrace", unimplementedFunc),
92    /* 27 */ SyscallDesc("alarm", unimplementedFunc),
93    /* 28 */ SyscallDesc("unused#28", unimplementedFunc),
94    /* 29 */ SyscallDesc("pause", unimplementedFunc),
95    /* 30 */ SyscallDesc("utime", unimplementedFunc),
96    /* 31 */ SyscallDesc("stty", unimplementedFunc),
97    /* 32 */ SyscallDesc("gtty", unimplementedFunc),
98    /* 33 */ SyscallDesc("access", unimplementedFunc),
99    /* 34 */ SyscallDesc("nice", unimplementedFunc),
100    /* 35 */ SyscallDesc("ftime", unimplementedFunc),
101    /* 36 */ SyscallDesc("sync", unimplementedFunc),
102    /* 37 */ SyscallDesc("kill", ignoreFunc),
103    /* 38 */ SyscallDesc("rename", unimplementedFunc),
104    /* 39 */ SyscallDesc("mkdir", unimplementedFunc),
105    /* 40 */ SyscallDesc("rmdir", unimplementedFunc),
106    /* 41 */ SyscallDesc("dup", unimplementedFunc),
107    /* 42 */ SyscallDesc("pipe", unimplementedFunc),
108    /* 43 */ SyscallDesc("times", unimplementedFunc),
109    /* 44 */ SyscallDesc("prof", unimplementedFunc),
110    /* 45 */ SyscallDesc("brk", brkFunc),
111    /* 46 */ SyscallDesc("setgid", unimplementedFunc),
112    /* 47 */ SyscallDesc("getgid", getgidFunc),
113    /* 48 */ SyscallDesc("signal", ignoreFunc),
114    /* 49 */ SyscallDesc("geteuid", geteuidFunc),
115    /* 50 */ SyscallDesc("getegid", getegidFunc),
116    /* 51 */ SyscallDesc("acct", unimplementedFunc),
117    /* 52 */ SyscallDesc("umount2", unimplementedFunc),
118    /* 53 */ SyscallDesc("lock", unimplementedFunc),
119    /* 54 */ SyscallDesc("ioctl", ioctlFunc<ArmLinux>),
120    /* 55 */ SyscallDesc("fcntl", fcntlFunc),
121    /* 56 */ SyscallDesc("mpx", unimplementedFunc),
122    /* 57 */ SyscallDesc("setpgid", unimplementedFunc),
123    /* 58 */ SyscallDesc("ulimit", unimplementedFunc),
124    /* 59 */ SyscallDesc("unused#59", unimplementedFunc),
125    /* 60 */ SyscallDesc("umask", unimplementedFunc),
126    /* 61 */ SyscallDesc("chroot", unimplementedFunc),
127    /* 62 */ SyscallDesc("ustat", unimplementedFunc),
128    /* 63 */ SyscallDesc("dup2", unimplementedFunc),
129    /* 64 */ SyscallDesc("getppid", getpagesizeFunc),
130    /* 65 */ SyscallDesc("getpgrp", unimplementedFunc),
131    /* 66 */ SyscallDesc("setsid", unimplementedFunc),
132    /* 67 */ SyscallDesc("sigaction",unimplementedFunc),
133    /* 68 */ SyscallDesc("sgetmask", unimplementedFunc),
134    /* 69 */ SyscallDesc("ssetmask", unimplementedFunc),
135    /* 70 */ SyscallDesc("setreuid", unimplementedFunc),
136    /* 71 */ SyscallDesc("setregid", unimplementedFunc),
137    /* 72 */ SyscallDesc("sigsuspend", unimplementedFunc),
138    /* 73 */ SyscallDesc("sigpending", unimplementedFunc),
139    /* 74 */ SyscallDesc("sethostname", ignoreFunc),
140    /* 75 */ SyscallDesc("setrlimit", unimplementedFunc),
141    /* 76 */ SyscallDesc("getrlimit", unimplementedFunc),
142    /* 77 */ SyscallDesc("getrusage", unimplementedFunc),
143    /* 78 */ SyscallDesc("gettimeofday", unimplementedFunc),
144    /* 79 */ SyscallDesc("settimeofday", unimplementedFunc),
145    /* 80 */ SyscallDesc("getgroups", unimplementedFunc),
146    /* 81 */ SyscallDesc("setgroups", unimplementedFunc),
147    /* 82 */ SyscallDesc("reserved#82", unimplementedFunc),
148    /* 83 */ SyscallDesc("symlink", unimplementedFunc),
149    /* 84 */ SyscallDesc("unused#84", unimplementedFunc),
150    /* 85 */ SyscallDesc("readlink", unimplementedFunc),
151    /* 86 */ SyscallDesc("uselib", unimplementedFunc),
152    /* 87 */ SyscallDesc("swapon", gethostnameFunc),
153    /* 88 */ SyscallDesc("reboot", unimplementedFunc),
154    /* 89 */ SyscallDesc("readdir", unimplementedFunc),
155    /* 90 */ SyscallDesc("mmap", mmapFunc<ArmLinux>),
156    /* 91 */ SyscallDesc("munmap",munmapFunc),
157    /* 92 */ SyscallDesc("truncate", truncateFunc),
158    /* 93 */ SyscallDesc("ftruncate", ftruncateFunc),
159    /* 94 */ SyscallDesc("fchmod", unimplementedFunc),
160    /* 95 */ SyscallDesc("fchown", unimplementedFunc),
161    /* 96 */ SyscallDesc("getpriority", unimplementedFunc),
162    /* 97 */ SyscallDesc("setpriority", unimplementedFunc),
163    /* 98 */ SyscallDesc("profil", unimplementedFunc),
164    /* 99 */ SyscallDesc("statfs", unimplementedFunc),
165    /* 100 */ SyscallDesc("fstatfs", unimplementedFunc),
166    /* 101 */ SyscallDesc("ioperm", unimplementedFunc),
167    /* 102 */ SyscallDesc("socketcall", unimplementedFunc),
168    /* 103 */ SyscallDesc("syslog", unimplementedFunc),
169    /* 104 */ SyscallDesc("setitimer", unimplementedFunc),
170    /* 105 */ SyscallDesc("getitimer", unimplementedFunc),
171    /* 106 */ SyscallDesc("stat",  statFunc<ArmLinux>),
172    /* 107 */ SyscallDesc("lstat", unimplementedFunc),
173    /* 108 */ SyscallDesc("fstat", fstatFunc<ArmLinux>),
174    /* 109 */ SyscallDesc("unused#109", unimplementedFunc),
175    /* 110 */ SyscallDesc("iopl", unimplementedFunc),
176    /* 111 */ SyscallDesc("vhangup", unimplementedFunc),
177    /* 112 */ SyscallDesc("idle", ignoreFunc),
178    /* 113 */ SyscallDesc("vm86", unimplementedFunc),
179    /* 114 */ SyscallDesc("wait4", unimplementedFunc),
180    /* 115 */ SyscallDesc("swapoff", unimplementedFunc),
181    /* 116 */ SyscallDesc("sysinfo", unimplementedFunc),
182    /* 117 */ SyscallDesc("ipc", unimplementedFunc),
183    /* 118 */ SyscallDesc("fsync", unimplementedFunc),
184    /* 119 */ SyscallDesc("sigreturn", unimplementedFunc),
185    /* 120 */ SyscallDesc("clone", unimplementedFunc),
186    /* 121 */ SyscallDesc("setdomainname", unimplementedFunc),
187    /* 122 */ SyscallDesc("uname", unameFunc),
188    /* 123 */ SyscallDesc("modify_ldt", unimplementedFunc),
189    /* 124 */ SyscallDesc("adjtimex", unimplementedFunc),
190    /* 125 */ SyscallDesc("mprotect", ignoreFunc),
191    /* 126 */ SyscallDesc("sigprocmask", unimplementedFunc),
192    /* 127 */ SyscallDesc("create_module", unimplementedFunc),
193    /* 128 */ SyscallDesc("init_module", unimplementedFunc),
194    /* 129 */ SyscallDesc("delete_module", unimplementedFunc),
195    /* 130 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
196    /* 131 */ SyscallDesc("quotactl", unimplementedFunc),
197    /* 132 */ SyscallDesc("getpgid", unimplementedFunc),
198    /* 133 */ SyscallDesc("fchdir", unimplementedFunc),
199    /* 134 */ SyscallDesc("bdflush", unimplementedFunc),
200    /* 135 */ SyscallDesc("sysfs", unimplementedFunc),
201    /* 136 */ SyscallDesc("personality", unimplementedFunc),
202    /* 137 */ SyscallDesc("afs_syscall", unimplementedFunc),
203    /* 138 */ SyscallDesc("setfsuid", unimplementedFunc),
204    /* 139 */ SyscallDesc("setfsgid", unimplementedFunc),
205    /* 140 */ SyscallDesc("llseek", unimplementedFunc),
206    /* 141 */ SyscallDesc("getdents", unimplementedFunc),
207    /* 142 */ SyscallDesc("newselect", unimplementedFunc),
208    /* 143 */ SyscallDesc("flock", unimplementedFunc),
209    /* 144 */ SyscallDesc("msync", unimplementedFunc),
210    /* 145 */ SyscallDesc("readv", unimplementedFunc),
211    /* 146 */ SyscallDesc("writev", writevFunc<ArmLinux>),
212    /* 147 */ SyscallDesc("getsid", unimplementedFunc),
213    /* 148 */ SyscallDesc("fdatasync", unimplementedFunc),
214    /* 149 */ SyscallDesc("sysctl", unimplementedFunc),
215    /* 150 */ SyscallDesc("mlock", unimplementedFunc),
216    /* 151 */ SyscallDesc("munlock", unimplementedFunc),
217    /* 152 */ SyscallDesc("mlockall", unimplementedFunc),
218    /* 153 */ SyscallDesc("munlockall", unimplementedFunc),
219    /* 154 */ SyscallDesc("sched_setparam", unimplementedFunc),
220    /* 155 */ SyscallDesc("sched_getparam", unimplementedFunc),
221    /* 156 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
222    /* 157 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
223    /* 158 */ SyscallDesc("sched_yield", unimplementedFunc),
224    /* 159 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
225    /* 160 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
226    /* 161 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
227    /* 162 */ SyscallDesc("nanosleep", unimplementedFunc),
228    /* 163 */ SyscallDesc("mremap", unimplementedFunc), // ARM-specific
229    /* 164 */ SyscallDesc("setresuid", unimplementedFunc),
230    /* 165 */ SyscallDesc("getresuid", unimplementedFunc),
231    /* 166 */ SyscallDesc("vm862", unimplementedFunc),
232    /* 167 */ SyscallDesc("query_module", unimplementedFunc),
233    /* 168 */ SyscallDesc("poll", unimplementedFunc),
234    /* 169 */ SyscallDesc("nfsservctl", unimplementedFunc),
235    /* 170 */ SyscallDesc("setresgid", unimplementedFunc),
236    /* 171 */ SyscallDesc("getresgid", unimplementedFunc),
237    /* 172 */ SyscallDesc("prctl", unimplementedFunc),
238    /* 173 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
239    /* 174 */ SyscallDesc("rt_sigaction", unimplementedFunc),
240    /* 175 */ SyscallDesc("rt_sigprocmask", unimplementedFunc),
241    /* 176 */ SyscallDesc("rt_sigpending", unimplementedFunc),
242    /* 177 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
243    /* 178 */ SyscallDesc("rt_sigqueueinfo", ignoreFunc),
244    /* 179 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
245    /* 180 */ SyscallDesc("pread64", unimplementedFunc),
246    /* 181 */ SyscallDesc("pwrite64", unimplementedFunc),
247    /* 182 */ SyscallDesc("chown", unimplementedFunc),
248    /* 183 */ SyscallDesc("getcwd", unimplementedFunc),
249    /* 184 */ SyscallDesc("capget", unimplementedFunc),
250    /* 185 */ SyscallDesc("capset", unimplementedFunc),
251    /* 186 */ SyscallDesc("sigaltstack", unimplementedFunc),
252    /* 187 */ SyscallDesc("sendfile", unimplementedFunc),
253    /* 188 */ SyscallDesc("getpmsg", unimplementedFunc),
254    /* 189 */ SyscallDesc("putpmsg", unimplementedFunc),
255    /* 190 */ SyscallDesc("vfork", unimplementedFunc),
256    /* 191 */ SyscallDesc("getrlimit", unimplementedFunc),
257    /* 192 */ SyscallDesc("mmap2", unimplementedFunc),
258    /* 193 */ SyscallDesc("truncate64", unimplementedFunc),
259    /* 194 */ SyscallDesc("ftruncate64", unimplementedFunc),
260    /* 195 */ SyscallDesc("stat64", unimplementedFunc),
261    /* 196 */ SyscallDesc("lstat64", lstat64Func<ArmLinux>),
262    /* 197 */ SyscallDesc("fstat64", fstatFunc<ArmLinux>),
263    /* 198 */ SyscallDesc("lchown", unimplementedFunc),
264    /* 199 */ SyscallDesc("getuid", getuidFunc),
265    /* 200 */ SyscallDesc("getgid", getgidFunc),
266    /* 201 */ SyscallDesc("geteuid", geteuidFunc),
267    /* 202 */ SyscallDesc("getegid", getegidFunc),
268    /* 203 */ SyscallDesc("setreuid", unimplementedFunc),
269    /* 204 */ SyscallDesc("setregid", unimplementedFunc),
270    /* 205 */ SyscallDesc("getgroups", unimplementedFunc),
271    /* 206 */ SyscallDesc("setgroups", unimplementedFunc),
272    /* 207 */ SyscallDesc("fchown", unimplementedFunc),
273    /* 208 */ SyscallDesc("setresuid", unimplementedFunc),
274    /* 209 */ SyscallDesc("getresuid", unimplementedFunc),
275    /* 210 */ SyscallDesc("setresgid", unimplementedFunc),
276    /* 211 */ SyscallDesc("getresgid", unimplementedFunc),
277    /* 212 */ SyscallDesc("chown", unimplementedFunc),
278    /* 213 */ SyscallDesc("setuid", unimplementedFunc),
279    /* 214 */ SyscallDesc("setgid", unimplementedFunc),
280    /* 215 */ SyscallDesc("setfsuid", unimplementedFunc),
281    /* 216 */ SyscallDesc("setfsgid", unimplementedFunc),
282    /* 217 */ SyscallDesc("getdents64", unimplementedFunc),
283    /* 218 */ SyscallDesc("pivot_root", unimplementedFunc),
284    /* 219 */ SyscallDesc("mincore", unimplementedFunc),
285    /* 220 */ SyscallDesc("madvise", unimplementedFunc),
286    /* 221 */ SyscallDesc("fcntl64", fcntl64Func),
287    /* 222 */ SyscallDesc("tux", unimplementedFunc),
288    /* 223 */ SyscallDesc("unknown#223", unimplementedFunc),
289    /* 224 */ SyscallDesc("gettid", unimplementedFunc),
290    /* 225 */ SyscallDesc("readahead", unimplementedFunc),
291    /* 226 */ SyscallDesc("setxattr", unimplementedFunc),
292    /* 227 */ SyscallDesc("lsetxattr", unimplementedFunc),
293    /* 228 */ SyscallDesc("fsetxattr", unimplementedFunc),
294    /* 229 */ SyscallDesc("getxattr", unimplementedFunc),
295    /* 230 */ SyscallDesc("lgetxattr", unimplementedFunc),
296    /* 231 */ SyscallDesc("fgetxattr", unimplementedFunc),
297    /* 232 */ SyscallDesc("listxattr", unimplementedFunc),
298    /* 233 */ SyscallDesc("llistxattr", unimplementedFunc),
299    /* 234 */ SyscallDesc("flistxattr", unimplementedFunc),
300    /* 235 */ SyscallDesc("removexattr", unimplementedFunc),
301    /* 236 */ SyscallDesc("lremovexattr", unimplementedFunc),
302    /* 237 */ SyscallDesc("fremovexattr", unimplementedFunc),
303    /* 238 */ SyscallDesc("tkill", unimplementedFunc),
304    /* 239 */ SyscallDesc("sendfile64", unimplementedFunc),
305    /* 240 */ SyscallDesc("futex", unimplementedFunc),
306    /* 241 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
307    /* 242 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
308    /* 243 */ SyscallDesc("io_setup", unimplementedFunc),
309    /* 244 */ SyscallDesc("io_destory", unimplementedFunc),
310    /* 245 */ SyscallDesc("io_getevents", unimplementedFunc),
311    /* 246 */ SyscallDesc("io_submit", unimplementedFunc),
312    /* 247 */ SyscallDesc("io_cancel", unimplementedFunc),
313    /* 248 */ SyscallDesc("exit_group", exitFunc),
314    /* 249 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
315    /* 250 */ SyscallDesc("epoll_create", unimplementedFunc),
316    /* 251 */ SyscallDesc("epoll_ctl", unimplementedFunc),
317    /* 252 */ SyscallDesc("epoll_wait", unimplementedFunc),
318    /* 253 */ SyscallDesc("remap_file_pages", unimplementedFunc),
319    /* 254 */ SyscallDesc("set_thread_area", unimplementedFunc),
320    /* 255 */ SyscallDesc("get_thread_area", unimplementedFunc),
321    /* 256 */ SyscallDesc("set_tid_address", unimplementedFunc),
322    /* 257 */ SyscallDesc("timer_create", unimplementedFunc),
323    /* 258 */ SyscallDesc("timer_settime", unimplementedFunc),
324    /* 259 */ SyscallDesc("timer_gettime", unimplementedFunc),
325    /* 260 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
326    /* 261 */ SyscallDesc("timer_delete", unimplementedFunc),
327    /* 262 */ SyscallDesc("clock_settime", unimplementedFunc),
328    /* 263 */ SyscallDesc("clock_gettime", unimplementedFunc),
329    /* 264 */ SyscallDesc("clock_getres", unimplementedFunc),
330    /* 265 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
331    /* 266 */ SyscallDesc("statfs64", unimplementedFunc),
332    /* 267 */ SyscallDesc("fstatfs64", unimplementedFunc),
333    /* 268 */ SyscallDesc("tgkill", unimplementedFunc),
334    /* 269 */ SyscallDesc("utimes", unimplementedFunc),
335    /* 270 */ SyscallDesc("arm_fadvise64_64", unimplementedFunc),
336    /* 271 */ SyscallDesc("pciconfig_iobase", unimplementedFunc),
337    /* 272 */ SyscallDesc("pciconfig_read", unimplementedFunc),
338    /* 273 */ SyscallDesc("pciconfig_write", unimplementedFunc),
339    /* 274 */ SyscallDesc("mq_open", unimplementedFunc),
340    /* 275 */ SyscallDesc("mq_unlink", unimplementedFunc),
341    /* 276 */ SyscallDesc("mq_timedsend", unimplementedFunc),
342    /* 277 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
343    /* 278 */ SyscallDesc("mq_notify", unimplementedFunc),
344    /* 279 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
345    /* 280 */ SyscallDesc("waitid", unimplementedFunc),
346    /* 281 */ SyscallDesc("socket", unimplementedFunc),
347    /* 282 */ SyscallDesc("bind", unimplementedFunc),
348    /* 283 */ SyscallDesc("connect", unimplementedFunc),
349    /* 284 */ SyscallDesc("listen", unimplementedFunc),
350    /* 285 */ SyscallDesc("accept", unimplementedFunc),
351    /* 286 */ SyscallDesc("getsockname", unimplementedFunc),
352    /* 287 */ SyscallDesc("getpeername", unimplementedFunc),
353    /* 288 */ SyscallDesc("socketpair", unimplementedFunc),
354    /* 289 */ SyscallDesc("send", unimplementedFunc),
355    /* 290 */ SyscallDesc("sendto", unimplementedFunc),
356    /* 291 */ SyscallDesc("recv", unimplementedFunc),
357    /* 292 */ SyscallDesc("recvfrom", unimplementedFunc),
358    /* 293 */ SyscallDesc("shutdown", unimplementedFunc),
359    /* 294 */ SyscallDesc("setsockopt", unimplementedFunc),
360    /* 295 */ SyscallDesc("getsockopt", unimplementedFunc),
361    /* 296 */ SyscallDesc("sendmsg", unimplementedFunc),
362    /* 297 */ SyscallDesc("rcvmsg", unimplementedFunc),
363    /* 298 */ SyscallDesc("semop", unimplementedFunc),
364    /* 299 */ SyscallDesc("semget", unimplementedFunc),
365    /* 300 */ SyscallDesc("semctl", unimplementedFunc),
366    /* 301 */ SyscallDesc("msgsend", unimplementedFunc),
367    /* 302 */ SyscallDesc("msgrcv", unimplementedFunc),
368    /* 303 */ SyscallDesc("msgget", unimplementedFunc),
369    /* 304 */ SyscallDesc("msgctl", unimplementedFunc),
370    /* 305 */ SyscallDesc("shmat", unimplementedFunc),
371    /* 306 */ SyscallDesc("shmdt", unimplementedFunc),
372    /* 307 */ SyscallDesc("shmget", unimplementedFunc),
373    /* 308 */ SyscallDesc("shmctl", unimplementedFunc),
374    /* 309 */ SyscallDesc("add_key", unimplementedFunc),
375    /* 310 */ SyscallDesc("request_key", unimplementedFunc),
376    /* 311 */ SyscallDesc("keyctl", unimplementedFunc),
377    /* 312 */ SyscallDesc("semtimedop", unimplementedFunc),
378    /* 313 */ SyscallDesc("vserver", unimplementedFunc),
379    /* 314 */ SyscallDesc("ioprio_set", unimplementedFunc),
380    /* 315 */ SyscallDesc("ioprio_get", unimplementedFunc),
381    /* 316 */ SyscallDesc("inotify_init", unimplementedFunc),
382    /* 317 */ SyscallDesc("inotify_add_watch", unimplementedFunc),
383    /* 318 */ SyscallDesc("inotify_rm_watch", unimplementedFunc),
384    /* 319 */ SyscallDesc("mbind", unimplementedFunc),
385    /* 320 */ SyscallDesc("get_mempolicy", unimplementedFunc),
386    /* 321 */ SyscallDesc("set_mempolicy", unimplementedFunc),
387    /* 322 */ SyscallDesc("openat", unimplementedFunc),
388    /* 323 */ SyscallDesc("mkdirat", unimplementedFunc),
389    /* 324 */ SyscallDesc("mknodat", unimplementedFunc),
390    /* 325 */ SyscallDesc("fchownat", unimplementedFunc),
391    /* 326 */ SyscallDesc("futimesat", unimplementedFunc),
392    /* 327 */ SyscallDesc("fstatat64", unimplementedFunc),
393    /* 328 */ SyscallDesc("unlinkat", unimplementedFunc),
394    /* 329 */ SyscallDesc("renameat", unimplementedFunc),
395    /* 330 */ SyscallDesc("linkat", unimplementedFunc),
396    /* 331 */ SyscallDesc("symlinkat", unimplementedFunc),
397    /* 332 */ SyscallDesc("readlinkat", unimplementedFunc),
398    /* 333 */ SyscallDesc("fchmodat", unimplementedFunc),
399    /* 334 */ SyscallDesc("faccessat", unimplementedFunc),
400    /* 335 */ SyscallDesc("pselect6", unimplementedFunc),
401    /* 336 */ SyscallDesc("ppoll", unimplementedFunc),
402    /* 337 */ SyscallDesc("unshare", unimplementedFunc),
403    /* 338 */ SyscallDesc("set_robust_list", unimplementedFunc),
404    /* 339 */ SyscallDesc("get_robust_list", unimplementedFunc),
405    /* 340 */ SyscallDesc("splice", unimplementedFunc),
406    /* 341 */ SyscallDesc("arm_sync_file_range", unimplementedFunc),
407    /* 342 */ SyscallDesc("tee", unimplementedFunc),
408    /* 343 */ SyscallDesc("vmsplice", unimplementedFunc),
409    /* 344 */ SyscallDesc("move_pages", unimplementedFunc),
410    /* 345 */ SyscallDesc("getcpu", unimplementedFunc),
411    /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
412};
413
414ArmLinuxProcess::ArmLinuxProcess(LiveProcessParams * params,
415        ObjectFile *objFile)
416    : ArmLiveProcess(params, objFile),
417     Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
418{ }
419
420SyscallDesc*
421ArmLinuxProcess::getDesc(int callnum)
422{
423    // Angel SWI syscalls are unsupported in this release
424    if (callnum == 0x123456)
425        panic("Attempt to execute an ANGEL_SWI system call (newlib-related)");
426    else if ((callnum & 0x00f00000) == 0x00900000)
427        callnum &= 0x000fffff;
428    // Linux syscalls have to strip off the 0x00900000
429
430    if (callnum < 0 || callnum > Num_Syscall_Descs)
431        return NULL;
432
433    return &syscallDescs[callnum];
434}
435