byte_swap.hh was removed from arch/alpha/, and replaced by sim/byteswap.hh. The new...
[gem5.git] / arch / alpha / alpha_linux_process.cc
1 /*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 namespace LittleEndian {}
30 using namespace LittleEndian;
31
32 #include <dirent.h>
33 #include <errno.h>
34 #include <fcntl.h> // for host open() flags
35 #include <string.h> // for memset()
36 #include <sys/stat.h>
37 #include <sys/types.h>
38 #include <unistd.h>
39
40 #include "cpu/base.hh"
41 #include "cpu/exec_context.hh"
42 #include "mem/functional/functional.hh"
43 #include "sim/fake_syscall.hh"
44 #include "sim/host.hh"
45 #include "sim/process.hh"
46 #include "sim/sim_events.hh"
47
48 #include "arch/alpha/alpha_common_syscall_emul.hh"
49 #include "sim/syscall_emul.hh"
50 #include "sim/root.hh" // for curTick & ticksPerSecond
51
52 #include "arch/alpha/alpha_linux_process.hh"
53
54 #include "base/trace.hh"
55
56 using namespace std;
57
58 ///
59 /// This class encapsulates the types, structures, constants,
60 /// functions, and syscall-number mappings specific to the Alpha Linux
61 /// syscall interface.
62 ///
63 class Linux {
64
65 public:
66
67 //@{
68 /// Basic Linux types.
69 typedef uint64_t size_t;
70 typedef uint64_t off_t;
71 typedef int64_t time_t;
72 typedef uint32_t uid_t;
73 typedef uint32_t gid_t;
74 //@}
75
76 //@{
77 /// open(2) flag values.
78 static const int TGT_O_RDONLY = 00000000; //!< O_RDONLY
79 static const int TGT_O_WRONLY = 00000001; //!< O_WRONLY
80 static const int TGT_O_RDWR = 00000002; //!< O_RDWR
81 static const int TGT_O_NONBLOCK = 00000004; //!< O_NONBLOCK
82 static const int TGT_O_APPEND = 00000010; //!< O_APPEND
83 static const int TGT_O_CREAT = 00001000; //!< O_CREAT
84 static const int TGT_O_TRUNC = 00002000; //!< O_TRUNC
85 static const int TGT_O_EXCL = 00004000; //!< O_EXCL
86 static const int TGT_O_NOCTTY = 00010000; //!< O_NOCTTY
87 static const int TGT_O_SYNC = 00040000; //!< O_SYNC
88 static const int TGT_O_DRD = 00100000; //!< O_DRD
89 static const int TGT_O_DIRECTIO = 00200000; //!< O_DIRECTIO
90 static const int TGT_O_CACHE = 00400000; //!< O_CACHE
91 static const int TGT_O_DSYNC = 02000000; //!< O_DSYNC
92 static const int TGT_O_RSYNC = 04000000; //!< O_RSYNC
93 //@}
94
95 /// This table maps the target open() flags to the corresponding
96 /// host open() flags.
97 static OpenFlagTransTable openFlagTable[];
98
99 /// Number of entries in openFlagTable[].
100 static const int NUM_OPEN_FLAGS;
101
102 /// Stat buffer. Note that we can't call it 'stat' since that
103 /// gets #defined to something else on some systems.
104 struct tgt_stat {
105 uint32_t st_dev; //!< device
106 uint32_t st_ino; //!< inode
107 uint32_t st_mode; //!< mode
108 uint32_t st_nlink; //!< link count
109 uint32_t st_uid; //!< owner's user ID
110 uint32_t st_gid; //!< owner's group ID
111 uint32_t st_rdev; //!< device number
112 int32_t _pad1; //!< for alignment
113 int64_t st_size; //!< file size in bytes
114 uint64_t st_atimeX; //!< time of last access
115 uint64_t st_mtimeX; //!< time of last modification
116 uint64_t st_ctimeX; //!< time of last status change
117 uint32_t st_blksize; //!< optimal I/O block size
118 int32_t st_blocks; //!< number of blocks allocated
119 uint32_t st_flags; //!< flags
120 uint32_t st_gen; //!< unknown
121 };
122
123 // same for stat64
124 struct tgt_stat64 {
125 uint64_t st_dev;
126 uint64_t st_ino;
127 uint64_t st_rdev;
128 int64_t st_size;
129 uint64_t st_blocks;
130
131 uint32_t st_mode;
132 uint32_t st_uid;
133 uint32_t st_gid;
134 uint32_t st_blksize;
135 uint32_t st_nlink;
136 uint32_t __pad0;
137
138 uint64_t tgt_st_atime;
139 uint64_t st_atime_nsec;
140 uint64_t tgt_st_mtime;
141 uint64_t st_mtime_nsec;
142 uint64_t tgt_st_ctime;
143 uint64_t st_ctime_nsec;
144 int64_t __unused[3];
145 };
146
147 /// Length of strings in struct utsname (plus 1 for null char).
148 static const int _SYS_NMLN = 65;
149
150 /// Interface struct for uname().
151 struct utsname {
152 char sysname[_SYS_NMLN]; //!< System name.
153 char nodename[_SYS_NMLN]; //!< Node name.
154 char release[_SYS_NMLN]; //!< OS release.
155 char version[_SYS_NMLN]; //!< OS version.
156 char machine[_SYS_NMLN]; //!< Machine type.
157 };
158
159
160 //@{
161 /// ioctl() command codes.
162 static const unsigned TIOCGETP = 0x40067408;
163 static const unsigned TIOCSETP = 0x80067409;
164 static const unsigned TIOCSETN = 0x8006740a;
165 static const unsigned TIOCSETC = 0x80067411;
166 static const unsigned TIOCGETC = 0x40067412;
167 static const unsigned FIONREAD = 0x4004667f;
168 static const unsigned TIOCISATTY = 0x2000745e;
169 static const unsigned TIOCGETS = 0x402c7413;
170 static const unsigned TIOCGETA = 0x40127417;
171 //@}
172
173 /// Resource enumeration for getrlimit().
174 enum rlimit_resources {
175 RLIMIT_CPU = 0,
176 RLIMIT_FSIZE = 1,
177 RLIMIT_DATA = 2,
178 RLIMIT_STACK = 3,
179 RLIMIT_CORE = 4,
180 RLIMIT_RSS = 5,
181 RLIMIT_NOFILE = 6,
182 RLIMIT_AS = 7,
183 RLIMIT_VMEM = 7,
184 RLIMIT_NPROC = 8,
185 RLIMIT_MEMLOCK = 9,
186 RLIMIT_LOCKS = 10
187 };
188
189 /// Limit struct for getrlimit/setrlimit.
190 struct rlimit {
191 uint64_t rlim_cur; //!< soft limit
192 uint64_t rlim_max; //!< hard limit
193 };
194
195
196 /// For mmap().
197 static const unsigned TGT_MAP_ANONYMOUS = 0x10;
198
199 /// For gettimeofday().
200 struct timeval {
201 int64_t tv_sec; //!< seconds
202 int64_t tv_usec; //!< microseconds
203 };
204
205 // For writev/readv
206 struct tgt_iovec {
207 uint64_t iov_base; // void *
208 uint64_t iov_len;
209 };
210
211 //@{
212 /// For getrusage().
213 static const int RUSAGE_SELF = 0;
214 static const int RUSAGE_CHILDREN = -1;
215 static const int RUSAGE_BOTH = -2;
216 //@}
217
218 /// For getrusage().
219 struct rusage {
220 struct timeval ru_utime; //!< user time used
221 struct timeval ru_stime; //!< system time used
222 int64_t ru_maxrss; //!< max rss
223 int64_t ru_ixrss; //!< integral shared memory size
224 int64_t ru_idrss; //!< integral unshared data "
225 int64_t ru_isrss; //!< integral unshared stack "
226 int64_t ru_minflt; //!< page reclaims - total vmfaults
227 int64_t ru_majflt; //!< page faults
228 int64_t ru_nswap; //!< swaps
229 int64_t ru_inblock; //!< block input operations
230 int64_t ru_oublock; //!< block output operations
231 int64_t ru_msgsnd; //!< messages sent
232 int64_t ru_msgrcv; //!< messages received
233 int64_t ru_nsignals; //!< signals received
234 int64_t ru_nvcsw; //!< voluntary context switches
235 int64_t ru_nivcsw; //!< involuntary "
236 };
237
238 /// Helper function to convert a host stat buffer to a target stat
239 /// buffer. Also copies the target buffer out to the simulated
240 /// memory space. Used by stat(), fstat(), and lstat().
241 static void
242 copyOutStatBuf(FunctionalMemory *mem, Addr addr, struct stat *host)
243 {
244 TypedBufferArg<Linux::tgt_stat> tgt(addr);
245
246 tgt->st_dev = host->st_dev;
247 tgt->st_ino = host->st_ino;
248 tgt->st_mode = host->st_mode;
249 tgt->st_nlink = host->st_nlink;
250 tgt->st_uid = host->st_uid;
251 tgt->st_gid = host->st_gid;
252 tgt->st_rdev = host->st_rdev;
253 tgt->st_size = host->st_size;
254 tgt->st_atimeX = host->st_atime;
255 tgt->st_mtimeX = host->st_mtime;
256 tgt->st_ctimeX = host->st_ctime;
257 tgt->st_blksize = host->st_blksize;
258 tgt->st_blocks = host->st_blocks;
259
260 tgt.copyOut(mem);
261 }
262
263 // Same for stat64
264 static void
265 copyOutStat64Buf(FunctionalMemory *mem, Addr addr, struct stat64 *host)
266 {
267 TypedBufferArg<Linux::tgt_stat64> tgt(addr);
268
269 // XXX byteswaps
270 tgt->st_dev = host->st_dev;
271 // XXX What about STAT64_HAS_BROKEN_ST_INO ???
272 tgt->st_ino = host->st_ino;
273 tgt->st_rdev = host->st_rdev;
274 tgt->st_size = host->st_size;
275 tgt->st_blocks = host->st_blocks;
276
277 tgt->st_mode = host->st_mode;
278 tgt->st_uid = host->st_uid;
279 tgt->st_gid = host->st_gid;
280 tgt->st_blksize = host->st_blksize;
281 tgt->st_nlink = host->st_nlink;
282 tgt->tgt_st_atime = host->st_atime;
283 tgt->tgt_st_mtime = host->st_mtime;
284 tgt->tgt_st_ctime = host->st_ctime;
285 #ifdef STAT_HAVE_NSEC
286 tgt->st_atime_nsec = host->st_atime_nsec;
287 tgt->st_mtime_nsec = host->st_mtime_nsec;
288 tgt->st_ctime_nsec = host->st_ctime_nsec;
289 #else
290 tgt->st_atime_nsec = 0;
291 tgt->st_mtime_nsec = 0;
292 tgt->st_ctime_nsec = 0;
293 #endif
294 tgt.copyOut(mem);
295 }
296
297 /// The target system's hostname.
298 static const char *hostname;
299
300 /// Target uname() handler.
301 static SyscallReturn
302 unameFunc(SyscallDesc *desc, int callnum, Process *process,
303 ExecContext *xc)
304 {
305 TypedBufferArg<Linux::utsname> name(xc->getSyscallArg(0));
306
307 strcpy(name->sysname, "Linux");
308 strcpy(name->nodename, hostname);
309 strcpy(name->release, "2.4.20");
310 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
311 strcpy(name->machine, "alpha");
312
313 name.copyOut(xc->mem);
314 return 0;
315 }
316
317 /// Target osf_getsysyinfo() handler. Even though this call is
318 /// borrowed from Tru64, the subcases that get used appear to be
319 /// different in practice from those used by Tru64 processes.
320 static SyscallReturn
321 osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
322 ExecContext *xc)
323 {
324 unsigned op = xc->getSyscallArg(0);
325 // unsigned nbytes = xc->getSyscallArg(2);
326
327 switch (op) {
328
329 case 45: { // GSI_IEEE_FP_CONTROL
330 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1));
331 // I don't think this exactly matches the HW FPCR
332 *fpcr = 0;
333 fpcr.copyOut(xc->mem);
334 return 0;
335 }
336
337 default:
338 cerr << "osf_getsysinfo: unknown op " << op << endl;
339 abort();
340 break;
341 }
342
343 return 1;
344 }
345
346 /// Target osf_setsysinfo() handler.
347 static SyscallReturn
348 osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
349 ExecContext *xc)
350 {
351 unsigned op = xc->getSyscallArg(0);
352 // unsigned nbytes = xc->getSyscallArg(2);
353
354 switch (op) {
355
356 case 14: { // SSI_IEEE_FP_CONTROL
357 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1));
358 // I don't think this exactly matches the HW FPCR
359 fpcr.copyIn(xc->mem);
360 DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): "
361 " setting FPCR to 0x%x\n", *(uint64_t*)fpcr);
362 return 0;
363 }
364
365 default:
366 cerr << "osf_setsysinfo: unknown op " << op << endl;
367 abort();
368 break;
369 }
370
371 return 1;
372 }
373
374 /// Target fnctl() handler.
375 static SyscallReturn
376 fcntlFunc(SyscallDesc *desc, int callnum, Process *process,
377 ExecContext *xc)
378 {
379 int fd = xc->getSyscallArg(0);
380
381 if (fd < 0 || process->sim_fd(fd) < 0)
382 return -EBADF;
383
384 int cmd = xc->getSyscallArg(1);
385 switch (cmd) {
386 case 0: // F_DUPFD
387 // if we really wanted to support this, we'd need to do it
388 // in the target fd space.
389 warn("fcntl(%d, F_DUPFD) not supported, error returned\n", fd);
390 return -EMFILE;
391
392 case 1: // F_GETFD (get close-on-exec flag)
393 case 2: // F_SETFD (set close-on-exec flag)
394 return 0;
395
396 case 3: // F_GETFL (get file flags)
397 case 4: // F_SETFL (set file flags)
398 // not sure if this is totally valid, but we'll pass it through
399 // to the underlying OS
400 warn("fcntl(%d, %d) passed through to host\n", fd, cmd);
401 return fcntl(process->sim_fd(fd), cmd);
402 // return 0;
403
404 case 7: // F_GETLK (get lock)
405 case 8: // F_SETLK (set lock)
406 case 9: // F_SETLKW (set lock and wait)
407 // don't mess with file locking... just act like it's OK
408 warn("File lock call (fcntl(%d, %d)) ignored.\n", fd, cmd);
409 return 0;
410
411 default:
412 warn("Unknown fcntl command %d\n", cmd);
413 return 0;
414 }
415 }
416
417 /// Array of syscall descriptors, indexed by call number.
418 static SyscallDesc syscallDescs[];
419
420 /// Number of syscalls in syscallDescs[].
421 static const int Num_Syscall_Descs;
422
423 /// Max supported syscall number.
424 static const int Max_Syscall_Desc;
425
426 /// Do the specified syscall. Just looks the call number up in
427 /// the table and invokes the appropriate handler.
428 static void
429 doSyscall(int callnum, Process *process, ExecContext *xc)
430 {
431 if (callnum < 0 || callnum > Max_Syscall_Desc) {
432 fatal("Syscall %d out of range", callnum);
433 }
434
435 SyscallDesc *desc = &syscallDescs[callnum];
436
437 desc->doSyscall(callnum, process, xc);
438 }
439 }; // class Linux
440
441
442 // open(2) flags translation table
443 OpenFlagTransTable Linux::openFlagTable[] = {
444 #ifdef _MSC_VER
445 { Linux::TGT_O_RDONLY, _O_RDONLY },
446 { Linux::TGT_O_WRONLY, _O_WRONLY },
447 { Linux::TGT_O_RDWR, _O_RDWR },
448 { Linux::TGT_O_APPEND, _O_APPEND },
449 { Linux::TGT_O_CREAT, _O_CREAT },
450 { Linux::TGT_O_TRUNC, _O_TRUNC },
451 { Linux::TGT_O_EXCL, _O_EXCL },
452 #ifdef _O_NONBLOCK
453 { Linux::TGT_O_NONBLOCK, _O_NONBLOCK },
454 #endif
455 #ifdef _O_NOCTTY
456 { Linux::TGT_O_NOCTTY, _O_NOCTTY },
457 #endif
458 #ifdef _O_SYNC
459 { Linux::TGT_O_SYNC, _O_SYNC },
460 #endif
461 #else /* !_MSC_VER */
462 { Linux::TGT_O_RDONLY, O_RDONLY },
463 { Linux::TGT_O_WRONLY, O_WRONLY },
464 { Linux::TGT_O_RDWR, O_RDWR },
465 { Linux::TGT_O_APPEND, O_APPEND },
466 { Linux::TGT_O_CREAT, O_CREAT },
467 { Linux::TGT_O_TRUNC, O_TRUNC },
468 { Linux::TGT_O_EXCL, O_EXCL },
469 { Linux::TGT_O_NONBLOCK, O_NONBLOCK },
470 { Linux::TGT_O_NOCTTY, O_NOCTTY },
471 #ifdef O_SYNC
472 { Linux::TGT_O_SYNC, O_SYNC },
473 #endif
474 #endif /* _MSC_VER */
475 };
476
477 const int Linux::NUM_OPEN_FLAGS =
478 (sizeof(Linux::openFlagTable)/sizeof(Linux::openFlagTable[0]));
479
480 const char *Linux::hostname = "m5.eecs.umich.edu";
481
482 SyscallDesc Linux::syscallDescs[] = {
483 /* 0 */ SyscallDesc("osf_syscall", unimplementedFunc),
484 /* 1 */ SyscallDesc("exit", exitFunc),
485 /* 2 */ SyscallDesc("fork", unimplementedFunc),
486 /* 3 */ SyscallDesc("read", readFunc),
487 /* 4 */ SyscallDesc("write", writeFunc),
488 /* 5 */ SyscallDesc("osf_old_open", unimplementedFunc),
489 /* 6 */ SyscallDesc("close", closeFunc),
490 /* 7 */ SyscallDesc("osf_wait4", unimplementedFunc),
491 /* 8 */ SyscallDesc("osf_old_creat", unimplementedFunc),
492 /* 9 */ SyscallDesc("link", unimplementedFunc),
493 /* 10 */ SyscallDesc("unlink", unlinkFunc),
494 /* 11 */ SyscallDesc("osf_execve", unimplementedFunc),
495 /* 12 */ SyscallDesc("chdir", unimplementedFunc),
496 /* 13 */ SyscallDesc("fchdir", unimplementedFunc),
497 /* 14 */ SyscallDesc("mknod", unimplementedFunc),
498 /* 15 */ SyscallDesc("chmod", chmodFunc<Linux>),
499 /* 16 */ SyscallDesc("chown", chownFunc),
500 /* 17 */ SyscallDesc("brk", obreakFunc),
501 /* 18 */ SyscallDesc("osf_getfsstat", unimplementedFunc),
502 /* 19 */ SyscallDesc("lseek", lseekFunc),
503 /* 20 */ SyscallDesc("getxpid", getpidFunc),
504 /* 21 */ SyscallDesc("osf_mount", unimplementedFunc),
505 /* 22 */ SyscallDesc("umount", unimplementedFunc),
506 /* 23 */ SyscallDesc("setuid", setuidFunc),
507 /* 24 */ SyscallDesc("getxuid", getuidFunc),
508 /* 25 */ SyscallDesc("exec_with_loader", unimplementedFunc),
509 /* 26 */ SyscallDesc("osf_ptrace", unimplementedFunc),
510 /* 27 */ SyscallDesc("osf_nrecvmsg", unimplementedFunc),
511 /* 28 */ SyscallDesc("osf_nsendmsg", unimplementedFunc),
512 /* 29 */ SyscallDesc("osf_nrecvfrom", unimplementedFunc),
513 /* 30 */ SyscallDesc("osf_naccept", unimplementedFunc),
514 /* 31 */ SyscallDesc("osf_ngetpeername", unimplementedFunc),
515 /* 32 */ SyscallDesc("osf_ngetsockname", unimplementedFunc),
516 /* 33 */ SyscallDesc("access", unimplementedFunc),
517 /* 34 */ SyscallDesc("osf_chflags", unimplementedFunc),
518 /* 35 */ SyscallDesc("osf_fchflags", unimplementedFunc),
519 /* 36 */ SyscallDesc("sync", unimplementedFunc),
520 /* 37 */ SyscallDesc("kill", unimplementedFunc),
521 /* 38 */ SyscallDesc("osf_old_stat", unimplementedFunc),
522 /* 39 */ SyscallDesc("setpgid", unimplementedFunc),
523 /* 40 */ SyscallDesc("osf_old_lstat", unimplementedFunc),
524 /* 41 */ SyscallDesc("dup", unimplementedFunc),
525 /* 42 */ SyscallDesc("pipe", unimplementedFunc),
526 /* 43 */ SyscallDesc("osf_set_program_attributes", unimplementedFunc),
527 /* 44 */ SyscallDesc("osf_profil", unimplementedFunc),
528 /* 45 */ SyscallDesc("open", openFunc<Linux>),
529 /* 46 */ SyscallDesc("osf_old_sigaction", unimplementedFunc),
530 /* 47 */ SyscallDesc("getxgid", getgidFunc),
531 /* 48 */ SyscallDesc("osf_sigprocmask", ignoreFunc),
532 /* 49 */ SyscallDesc("osf_getlogin", unimplementedFunc),
533 /* 50 */ SyscallDesc("osf_setlogin", unimplementedFunc),
534 /* 51 */ SyscallDesc("acct", unimplementedFunc),
535 /* 52 */ SyscallDesc("sigpending", unimplementedFunc),
536 /* 53 */ SyscallDesc("osf_classcntl", unimplementedFunc),
537 /* 54 */ SyscallDesc("ioctl", ioctlFunc<Linux>),
538 /* 55 */ SyscallDesc("osf_reboot", unimplementedFunc),
539 /* 56 */ SyscallDesc("osf_revoke", unimplementedFunc),
540 /* 57 */ SyscallDesc("symlink", unimplementedFunc),
541 /* 58 */ SyscallDesc("readlink", unimplementedFunc),
542 /* 59 */ SyscallDesc("execve", unimplementedFunc),
543 /* 60 */ SyscallDesc("umask", unimplementedFunc),
544 /* 61 */ SyscallDesc("chroot", unimplementedFunc),
545 /* 62 */ SyscallDesc("osf_old_fstat", unimplementedFunc),
546 /* 63 */ SyscallDesc("getpgrp", unimplementedFunc),
547 /* 64 */ SyscallDesc("getpagesize", getpagesizeFunc),
548 /* 65 */ SyscallDesc("osf_mremap", unimplementedFunc),
549 /* 66 */ SyscallDesc("vfork", unimplementedFunc),
550 /* 67 */ SyscallDesc("stat", statFunc<Linux>),
551 /* 68 */ SyscallDesc("lstat", lstatFunc<Linux>),
552 /* 69 */ SyscallDesc("osf_sbrk", unimplementedFunc),
553 /* 70 */ SyscallDesc("osf_sstk", unimplementedFunc),
554 /* 71 */ SyscallDesc("mmap", mmapFunc<Linux>),
555 /* 72 */ SyscallDesc("osf_old_vadvise", unimplementedFunc),
556 /* 73 */ SyscallDesc("munmap", munmapFunc),
557 /* 74 */ SyscallDesc("mprotect", ignoreFunc),
558 /* 75 */ SyscallDesc("madvise", unimplementedFunc),
559 /* 76 */ SyscallDesc("vhangup", unimplementedFunc),
560 /* 77 */ SyscallDesc("osf_kmodcall", unimplementedFunc),
561 /* 78 */ SyscallDesc("osf_mincore", unimplementedFunc),
562 /* 79 */ SyscallDesc("getgroups", unimplementedFunc),
563 /* 80 */ SyscallDesc("setgroups", unimplementedFunc),
564 /* 81 */ SyscallDesc("osf_old_getpgrp", unimplementedFunc),
565 /* 82 */ SyscallDesc("setpgrp", unimplementedFunc),
566 /* 83 */ SyscallDesc("osf_setitimer", unimplementedFunc),
567 /* 84 */ SyscallDesc("osf_old_wait", unimplementedFunc),
568 /* 85 */ SyscallDesc("osf_table", unimplementedFunc),
569 /* 86 */ SyscallDesc("osf_getitimer", unimplementedFunc),
570 /* 87 */ SyscallDesc("gethostname", gethostnameFunc),
571 /* 88 */ SyscallDesc("sethostname", unimplementedFunc),
572 /* 89 */ SyscallDesc("getdtablesize", unimplementedFunc),
573 /* 90 */ SyscallDesc("dup2", unimplementedFunc),
574 /* 91 */ SyscallDesc("fstat", fstatFunc<Linux>),
575 /* 92 */ SyscallDesc("fcntl", fcntlFunc),
576 /* 93 */ SyscallDesc("osf_select", unimplementedFunc),
577 /* 94 */ SyscallDesc("poll", unimplementedFunc),
578 /* 95 */ SyscallDesc("fsync", unimplementedFunc),
579 /* 96 */ SyscallDesc("setpriority", unimplementedFunc),
580 /* 97 */ SyscallDesc("socket", unimplementedFunc),
581 /* 98 */ SyscallDesc("connect", unimplementedFunc),
582 /* 99 */ SyscallDesc("accept", unimplementedFunc),
583 /* 100 */ SyscallDesc("getpriority", unimplementedFunc),
584 /* 101 */ SyscallDesc("send", unimplementedFunc),
585 /* 102 */ SyscallDesc("recv", unimplementedFunc),
586 /* 103 */ SyscallDesc("sigreturn", unimplementedFunc),
587 /* 104 */ SyscallDesc("bind", unimplementedFunc),
588 /* 105 */ SyscallDesc("setsockopt", unimplementedFunc),
589 /* 106 */ SyscallDesc("listen", unimplementedFunc),
590 /* 107 */ SyscallDesc("osf_plock", unimplementedFunc),
591 /* 108 */ SyscallDesc("osf_old_sigvec", unimplementedFunc),
592 /* 109 */ SyscallDesc("osf_old_sigblock", unimplementedFunc),
593 /* 110 */ SyscallDesc("osf_old_sigsetmask", unimplementedFunc),
594 /* 111 */ SyscallDesc("sigsuspend", unimplementedFunc),
595 /* 112 */ SyscallDesc("osf_sigstack", ignoreFunc),
596 /* 113 */ SyscallDesc("recvmsg", unimplementedFunc),
597 /* 114 */ SyscallDesc("sendmsg", unimplementedFunc),
598 /* 115 */ SyscallDesc("osf_old_vtrace", unimplementedFunc),
599 /* 116 */ SyscallDesc("osf_gettimeofday", unimplementedFunc),
600 /* 117 */ SyscallDesc("osf_getrusage", unimplementedFunc),
601 /* 118 */ SyscallDesc("getsockopt", unimplementedFunc),
602 /* 119 */ SyscallDesc("numa_syscalls", unimplementedFunc),
603 /* 120 */ SyscallDesc("readv", unimplementedFunc),
604 /* 121 */ SyscallDesc("writev", writevFunc<Linux>),
605 /* 122 */ SyscallDesc("osf_settimeofday", unimplementedFunc),
606 /* 123 */ SyscallDesc("fchown", fchownFunc),
607 /* 124 */ SyscallDesc("fchmod", fchmodFunc<Linux>),
608 /* 125 */ SyscallDesc("recvfrom", unimplementedFunc),
609 /* 126 */ SyscallDesc("setreuid", unimplementedFunc),
610 /* 127 */ SyscallDesc("setregid", unimplementedFunc),
611 /* 128 */ SyscallDesc("rename", renameFunc),
612 /* 129 */ SyscallDesc("truncate", unimplementedFunc),
613 /* 130 */ SyscallDesc("ftruncate", unimplementedFunc),
614 /* 131 */ SyscallDesc("flock", unimplementedFunc),
615 /* 132 */ SyscallDesc("setgid", unimplementedFunc),
616 /* 133 */ SyscallDesc("sendto", unimplementedFunc),
617 /* 134 */ SyscallDesc("shutdown", unimplementedFunc),
618 /* 135 */ SyscallDesc("socketpair", unimplementedFunc),
619 /* 136 */ SyscallDesc("mkdir", unimplementedFunc),
620 /* 137 */ SyscallDesc("rmdir", unimplementedFunc),
621 /* 138 */ SyscallDesc("osf_utimes", unimplementedFunc),
622 /* 139 */ SyscallDesc("osf_old_sigreturn", unimplementedFunc),
623 /* 140 */ SyscallDesc("osf_adjtime", unimplementedFunc),
624 /* 141 */ SyscallDesc("getpeername", unimplementedFunc),
625 /* 142 */ SyscallDesc("osf_gethostid", unimplementedFunc),
626 /* 143 */ SyscallDesc("osf_sethostid", unimplementedFunc),
627 /* 144 */ SyscallDesc("getrlimit", getrlimitFunc<Linux>),
628 /* 145 */ SyscallDesc("setrlimit", ignoreFunc),
629 /* 146 */ SyscallDesc("osf_old_killpg", unimplementedFunc),
630 /* 147 */ SyscallDesc("setsid", unimplementedFunc),
631 /* 148 */ SyscallDesc("quotactl", unimplementedFunc),
632 /* 149 */ SyscallDesc("osf_oldquota", unimplementedFunc),
633 /* 150 */ SyscallDesc("getsockname", unimplementedFunc),
634 /* 151 */ SyscallDesc("osf_pread", unimplementedFunc),
635 /* 152 */ SyscallDesc("osf_pwrite", unimplementedFunc),
636 /* 153 */ SyscallDesc("osf_pid_block", unimplementedFunc),
637 /* 154 */ SyscallDesc("osf_pid_unblock", unimplementedFunc),
638 /* 155 */ SyscallDesc("osf_signal_urti", unimplementedFunc),
639 /* 156 */ SyscallDesc("sigaction", ignoreFunc),
640 /* 157 */ SyscallDesc("osf_sigwaitprim", unimplementedFunc),
641 /* 158 */ SyscallDesc("osf_nfssvc", unimplementedFunc),
642 /* 159 */ SyscallDesc("osf_getdirentries", unimplementedFunc),
643 /* 160 */ SyscallDesc("osf_statfs", unimplementedFunc),
644 /* 161 */ SyscallDesc("osf_fstatfs", unimplementedFunc),
645 /* 162 */ SyscallDesc("unknown #162", unimplementedFunc),
646 /* 163 */ SyscallDesc("osf_async_daemon", unimplementedFunc),
647 /* 164 */ SyscallDesc("osf_getfh", unimplementedFunc),
648 /* 165 */ SyscallDesc("osf_getdomainname", unimplementedFunc),
649 /* 166 */ SyscallDesc("setdomainname", unimplementedFunc),
650 /* 167 */ SyscallDesc("unknown #167", unimplementedFunc),
651 /* 168 */ SyscallDesc("unknown #168", unimplementedFunc),
652 /* 169 */ SyscallDesc("osf_exportfs", unimplementedFunc),
653 /* 170 */ SyscallDesc("unknown #170", unimplementedFunc),
654 /* 171 */ SyscallDesc("unknown #171", unimplementedFunc),
655 /* 172 */ SyscallDesc("unknown #172", unimplementedFunc),
656 /* 173 */ SyscallDesc("unknown #173", unimplementedFunc),
657 /* 174 */ SyscallDesc("unknown #174", unimplementedFunc),
658 /* 175 */ SyscallDesc("unknown #175", unimplementedFunc),
659 /* 176 */ SyscallDesc("unknown #176", unimplementedFunc),
660 /* 177 */ SyscallDesc("unknown #177", unimplementedFunc),
661 /* 178 */ SyscallDesc("unknown #178", unimplementedFunc),
662 /* 179 */ SyscallDesc("unknown #179", unimplementedFunc),
663 /* 180 */ SyscallDesc("unknown #180", unimplementedFunc),
664 /* 181 */ SyscallDesc("osf_alt_plock", unimplementedFunc),
665 /* 182 */ SyscallDesc("unknown #182", unimplementedFunc),
666 /* 183 */ SyscallDesc("unknown #183", unimplementedFunc),
667 /* 184 */ SyscallDesc("osf_getmnt", unimplementedFunc),
668 /* 185 */ SyscallDesc("unknown #185", unimplementedFunc),
669 /* 186 */ SyscallDesc("unknown #186", unimplementedFunc),
670 /* 187 */ SyscallDesc("osf_alt_sigpending", unimplementedFunc),
671 /* 188 */ SyscallDesc("osf_alt_setsid", unimplementedFunc),
672 /* 189 */ SyscallDesc("unknown #189", unimplementedFunc),
673 /* 190 */ SyscallDesc("unknown #190", unimplementedFunc),
674 /* 191 */ SyscallDesc("unknown #191", unimplementedFunc),
675 /* 192 */ SyscallDesc("unknown #192", unimplementedFunc),
676 /* 193 */ SyscallDesc("unknown #193", unimplementedFunc),
677 /* 194 */ SyscallDesc("unknown #194", unimplementedFunc),
678 /* 195 */ SyscallDesc("unknown #195", unimplementedFunc),
679 /* 196 */ SyscallDesc("unknown #196", unimplementedFunc),
680 /* 197 */ SyscallDesc("unknown #197", unimplementedFunc),
681 /* 198 */ SyscallDesc("unknown #198", unimplementedFunc),
682 /* 199 */ SyscallDesc("osf_swapon", unimplementedFunc),
683 /* 200 */ SyscallDesc("msgctl", unimplementedFunc),
684 /* 201 */ SyscallDesc("msgget", unimplementedFunc),
685 /* 202 */ SyscallDesc("msgrcv", unimplementedFunc),
686 /* 203 */ SyscallDesc("msgsnd", unimplementedFunc),
687 /* 204 */ SyscallDesc("semctl", unimplementedFunc),
688 /* 205 */ SyscallDesc("semget", unimplementedFunc),
689 /* 206 */ SyscallDesc("semop", unimplementedFunc),
690 /* 207 */ SyscallDesc("osf_utsname", unimplementedFunc),
691 /* 208 */ SyscallDesc("lchown", unimplementedFunc),
692 /* 209 */ SyscallDesc("osf_shmat", unimplementedFunc),
693 /* 210 */ SyscallDesc("shmctl", unimplementedFunc),
694 /* 211 */ SyscallDesc("shmdt", unimplementedFunc),
695 /* 212 */ SyscallDesc("shmget", unimplementedFunc),
696 /* 213 */ SyscallDesc("osf_mvalid", unimplementedFunc),
697 /* 214 */ SyscallDesc("osf_getaddressconf", unimplementedFunc),
698 /* 215 */ SyscallDesc("osf_msleep", unimplementedFunc),
699 /* 216 */ SyscallDesc("osf_mwakeup", unimplementedFunc),
700 /* 217 */ SyscallDesc("msync", unimplementedFunc),
701 /* 218 */ SyscallDesc("osf_signal", unimplementedFunc),
702 /* 219 */ SyscallDesc("osf_utc_gettime", unimplementedFunc),
703 /* 220 */ SyscallDesc("osf_utc_adjtime", unimplementedFunc),
704 /* 221 */ SyscallDesc("unknown #221", unimplementedFunc),
705 /* 222 */ SyscallDesc("osf_security", unimplementedFunc),
706 /* 223 */ SyscallDesc("osf_kloadcall", unimplementedFunc),
707 /* 224 */ SyscallDesc("unknown #224", unimplementedFunc),
708 /* 225 */ SyscallDesc("unknown #225", unimplementedFunc),
709 /* 226 */ SyscallDesc("unknown #226", unimplementedFunc),
710 /* 227 */ SyscallDesc("unknown #227", unimplementedFunc),
711 /* 228 */ SyscallDesc("unknown #228", unimplementedFunc),
712 /* 229 */ SyscallDesc("unknown #229", unimplementedFunc),
713 /* 230 */ SyscallDesc("unknown #230", unimplementedFunc),
714 /* 231 */ SyscallDesc("unknown #231", unimplementedFunc),
715 /* 232 */ SyscallDesc("unknown #232", unimplementedFunc),
716 /* 233 */ SyscallDesc("getpgid", unimplementedFunc),
717 /* 234 */ SyscallDesc("getsid", unimplementedFunc),
718 /* 235 */ SyscallDesc("sigaltstack", ignoreFunc),
719 /* 236 */ SyscallDesc("osf_waitid", unimplementedFunc),
720 /* 237 */ SyscallDesc("osf_priocntlset", unimplementedFunc),
721 /* 238 */ SyscallDesc("osf_sigsendset", unimplementedFunc),
722 /* 239 */ SyscallDesc("osf_set_speculative", unimplementedFunc),
723 /* 240 */ SyscallDesc("osf_msfs_syscall", unimplementedFunc),
724 /* 241 */ SyscallDesc("osf_sysinfo", unimplementedFunc),
725 /* 242 */ SyscallDesc("osf_uadmin", unimplementedFunc),
726 /* 243 */ SyscallDesc("osf_fuser", unimplementedFunc),
727 /* 244 */ SyscallDesc("osf_proplist_syscall", unimplementedFunc),
728 /* 245 */ SyscallDesc("osf_ntp_adjtime", unimplementedFunc),
729 /* 246 */ SyscallDesc("osf_ntp_gettime", unimplementedFunc),
730 /* 247 */ SyscallDesc("osf_pathconf", unimplementedFunc),
731 /* 248 */ SyscallDesc("osf_fpathconf", unimplementedFunc),
732 /* 249 */ SyscallDesc("unknown #249", unimplementedFunc),
733 /* 250 */ SyscallDesc("osf_uswitch", unimplementedFunc),
734 /* 251 */ SyscallDesc("osf_usleep_thread", unimplementedFunc),
735 /* 252 */ SyscallDesc("osf_audcntl", unimplementedFunc),
736 /* 253 */ SyscallDesc("osf_audgen", unimplementedFunc),
737 /* 254 */ SyscallDesc("sysfs", unimplementedFunc),
738 /* 255 */ SyscallDesc("osf_subsys_info", unimplementedFunc),
739 /* 256 */ SyscallDesc("osf_getsysinfo", osf_getsysinfoFunc),
740 /* 257 */ SyscallDesc("osf_setsysinfo", osf_setsysinfoFunc),
741 /* 258 */ SyscallDesc("osf_afs_syscall", unimplementedFunc),
742 /* 259 */ SyscallDesc("osf_swapctl", unimplementedFunc),
743 /* 260 */ SyscallDesc("osf_memcntl", unimplementedFunc),
744 /* 261 */ SyscallDesc("osf_fdatasync", unimplementedFunc),
745 /* 262 */ SyscallDesc("unknown #262", unimplementedFunc),
746 /* 263 */ SyscallDesc("unknown #263", unimplementedFunc),
747 /* 264 */ SyscallDesc("unknown #264", unimplementedFunc),
748 /* 265 */ SyscallDesc("unknown #265", unimplementedFunc),
749 /* 266 */ SyscallDesc("unknown #266", unimplementedFunc),
750 /* 267 */ SyscallDesc("unknown #267", unimplementedFunc),
751 /* 268 */ SyscallDesc("unknown #268", unimplementedFunc),
752 /* 269 */ SyscallDesc("unknown #269", unimplementedFunc),
753 /* 270 */ SyscallDesc("unknown #270", unimplementedFunc),
754 /* 271 */ SyscallDesc("unknown #271", unimplementedFunc),
755 /* 272 */ SyscallDesc("unknown #272", unimplementedFunc),
756 /* 273 */ SyscallDesc("unknown #273", unimplementedFunc),
757 /* 274 */ SyscallDesc("unknown #274", unimplementedFunc),
758 /* 275 */ SyscallDesc("unknown #275", unimplementedFunc),
759 /* 276 */ SyscallDesc("unknown #276", unimplementedFunc),
760 /* 277 */ SyscallDesc("unknown #277", unimplementedFunc),
761 /* 278 */ SyscallDesc("unknown #278", unimplementedFunc),
762 /* 279 */ SyscallDesc("unknown #279", unimplementedFunc),
763 /* 280 */ SyscallDesc("unknown #280", unimplementedFunc),
764 /* 281 */ SyscallDesc("unknown #281", unimplementedFunc),
765 /* 282 */ SyscallDesc("unknown #282", unimplementedFunc),
766 /* 283 */ SyscallDesc("unknown #283", unimplementedFunc),
767 /* 284 */ SyscallDesc("unknown #284", unimplementedFunc),
768 /* 285 */ SyscallDesc("unknown #285", unimplementedFunc),
769 /* 286 */ SyscallDesc("unknown #286", unimplementedFunc),
770 /* 287 */ SyscallDesc("unknown #287", unimplementedFunc),
771 /* 288 */ SyscallDesc("unknown #288", unimplementedFunc),
772 /* 289 */ SyscallDesc("unknown #289", unimplementedFunc),
773 /* 290 */ SyscallDesc("unknown #290", unimplementedFunc),
774 /* 291 */ SyscallDesc("unknown #291", unimplementedFunc),
775 /* 292 */ SyscallDesc("unknown #292", unimplementedFunc),
776 /* 293 */ SyscallDesc("unknown #293", unimplementedFunc),
777 /* 294 */ SyscallDesc("unknown #294", unimplementedFunc),
778 /* 295 */ SyscallDesc("unknown #295", unimplementedFunc),
779 /* 296 */ SyscallDesc("unknown #296", unimplementedFunc),
780 /* 297 */ SyscallDesc("unknown #297", unimplementedFunc),
781 /* 298 */ SyscallDesc("unknown #298", unimplementedFunc),
782 /* 299 */ SyscallDesc("unknown #299", unimplementedFunc),
783 /*
784 * Linux-specific system calls begin at 300
785 */
786 /* 300 */ SyscallDesc("bdflush", unimplementedFunc),
787 /* 301 */ SyscallDesc("sethae", unimplementedFunc),
788 /* 302 */ SyscallDesc("mount", unimplementedFunc),
789 /* 303 */ SyscallDesc("old_adjtimex", unimplementedFunc),
790 /* 304 */ SyscallDesc("swapoff", unimplementedFunc),
791 /* 305 */ SyscallDesc("getdents", unimplementedFunc),
792 /* 306 */ SyscallDesc("create_module", unimplementedFunc),
793 /* 307 */ SyscallDesc("init_module", unimplementedFunc),
794 /* 308 */ SyscallDesc("delete_module", unimplementedFunc),
795 /* 309 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
796 /* 310 */ SyscallDesc("syslog", unimplementedFunc),
797 /* 311 */ SyscallDesc("reboot", unimplementedFunc),
798 /* 312 */ SyscallDesc("clone", unimplementedFunc),
799 /* 313 */ SyscallDesc("uselib", unimplementedFunc),
800 /* 314 */ SyscallDesc("mlock", unimplementedFunc),
801 /* 315 */ SyscallDesc("munlock", unimplementedFunc),
802 /* 316 */ SyscallDesc("mlockall", unimplementedFunc),
803 /* 317 */ SyscallDesc("munlockall", unimplementedFunc),
804 /* 318 */ SyscallDesc("sysinfo", unimplementedFunc),
805 /* 319 */ SyscallDesc("_sysctl", unimplementedFunc),
806 /* 320 */ SyscallDesc("was sys_idle", unimplementedFunc),
807 /* 321 */ SyscallDesc("oldumount", unimplementedFunc),
808 /* 322 */ SyscallDesc("swapon", unimplementedFunc),
809 /* 323 */ SyscallDesc("times", ignoreFunc),
810 /* 324 */ SyscallDesc("personality", unimplementedFunc),
811 /* 325 */ SyscallDesc("setfsuid", unimplementedFunc),
812 /* 326 */ SyscallDesc("setfsgid", unimplementedFunc),
813 /* 327 */ SyscallDesc("ustat", unimplementedFunc),
814 /* 328 */ SyscallDesc("statfs", unimplementedFunc),
815 /* 329 */ SyscallDesc("fstatfs", unimplementedFunc),
816 /* 330 */ SyscallDesc("sched_setparam", unimplementedFunc),
817 /* 331 */ SyscallDesc("sched_getparam", unimplementedFunc),
818 /* 332 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
819 /* 333 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
820 /* 334 */ SyscallDesc("sched_yield", unimplementedFunc),
821 /* 335 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
822 /* 336 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
823 /* 337 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
824 /* 338 */ SyscallDesc("afs_syscall", unimplementedFunc),
825 /* 339 */ SyscallDesc("uname", unameFunc),
826 /* 340 */ SyscallDesc("nanosleep", unimplementedFunc),
827 /* 341 */ SyscallDesc("mremap", unimplementedFunc),
828 /* 342 */ SyscallDesc("nfsservctl", unimplementedFunc),
829 /* 343 */ SyscallDesc("setresuid", unimplementedFunc),
830 /* 344 */ SyscallDesc("getresuid", unimplementedFunc),
831 /* 345 */ SyscallDesc("pciconfig_read", unimplementedFunc),
832 /* 346 */ SyscallDesc("pciconfig_write", unimplementedFunc),
833 /* 347 */ SyscallDesc("query_module", unimplementedFunc),
834 /* 348 */ SyscallDesc("prctl", unimplementedFunc),
835 /* 349 */ SyscallDesc("pread", unimplementedFunc),
836 /* 350 */ SyscallDesc("pwrite", unimplementedFunc),
837 /* 351 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
838 /* 352 */ SyscallDesc("rt_sigaction", ignoreFunc),
839 /* 353 */ SyscallDesc("rt_sigprocmask", unimplementedFunc),
840 /* 354 */ SyscallDesc("rt_sigpending", unimplementedFunc),
841 /* 355 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
842 /* 356 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc),
843 /* 357 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
844 /* 358 */ SyscallDesc("select", unimplementedFunc),
845 /* 359 */ SyscallDesc("gettimeofday", gettimeofdayFunc<Linux>),
846 /* 360 */ SyscallDesc("settimeofday", unimplementedFunc),
847 /* 361 */ SyscallDesc("getitimer", unimplementedFunc),
848 /* 362 */ SyscallDesc("setitimer", unimplementedFunc),
849 /* 363 */ SyscallDesc("utimes", utimesFunc<Linux>),
850 /* 364 */ SyscallDesc("getrusage", getrusageFunc<Linux>),
851 /* 365 */ SyscallDesc("wait4", unimplementedFunc),
852 /* 366 */ SyscallDesc("adjtimex", unimplementedFunc),
853 /* 367 */ SyscallDesc("getcwd", unimplementedFunc),
854 /* 368 */ SyscallDesc("capget", unimplementedFunc),
855 /* 369 */ SyscallDesc("capset", unimplementedFunc),
856 /* 370 */ SyscallDesc("sendfile", unimplementedFunc),
857 /* 371 */ SyscallDesc("setresgid", unimplementedFunc),
858 /* 372 */ SyscallDesc("getresgid", unimplementedFunc),
859 /* 373 */ SyscallDesc("dipc", unimplementedFunc),
860 /* 374 */ SyscallDesc("pivot_root", unimplementedFunc),
861 /* 375 */ SyscallDesc("mincore", unimplementedFunc),
862 /* 376 */ SyscallDesc("pciconfig_iobase", unimplementedFunc),
863 /* 377 */ SyscallDesc("getdents64", unimplementedFunc),
864 /* 378 */ SyscallDesc("gettid", unimplementedFunc),
865 /* 379 */ SyscallDesc("readahead", unimplementedFunc),
866 /* 380 */ SyscallDesc("security", unimplementedFunc),
867 /* 381 */ SyscallDesc("tkill", unimplementedFunc),
868 /* 382 */ SyscallDesc("setxattr", unimplementedFunc),
869 /* 383 */ SyscallDesc("lsetxattr", unimplementedFunc),
870 /* 384 */ SyscallDesc("fsetxattr", unimplementedFunc),
871 /* 385 */ SyscallDesc("getxattr", unimplementedFunc),
872 /* 386 */ SyscallDesc("lgetxattr", unimplementedFunc),
873 /* 387 */ SyscallDesc("fgetxattr", unimplementedFunc),
874 /* 388 */ SyscallDesc("listxattr", unimplementedFunc),
875 /* 389 */ SyscallDesc("llistxattr", unimplementedFunc),
876 /* 390 */ SyscallDesc("flistxattr", unimplementedFunc),
877 /* 391 */ SyscallDesc("removexattr", unimplementedFunc),
878 /* 392 */ SyscallDesc("lremovexattr", unimplementedFunc),
879 /* 393 */ SyscallDesc("fremovexattr", unimplementedFunc),
880 /* 394 */ SyscallDesc("futex", unimplementedFunc),
881 /* 395 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
882 /* 396 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
883 /* 397 */ SyscallDesc("tuxcall", unimplementedFunc),
884 /* 398 */ SyscallDesc("io_setup", unimplementedFunc),
885 /* 399 */ SyscallDesc("io_destroy", unimplementedFunc),
886 /* 400 */ SyscallDesc("io_getevents", unimplementedFunc),
887 /* 401 */ SyscallDesc("io_submit", unimplementedFunc),
888 /* 402 */ SyscallDesc("io_cancel", unimplementedFunc),
889 /* 403 */ SyscallDesc("unknown #403", unimplementedFunc),
890 /* 404 */ SyscallDesc("unknown #404", unimplementedFunc),
891 /* 405 */ SyscallDesc("exit_group", exitFunc), // exit all threads...
892 /* 406 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
893 /* 407 */ SyscallDesc("sys_epoll_create", unimplementedFunc),
894 /* 408 */ SyscallDesc("sys_epoll_ctl", unimplementedFunc),
895 /* 409 */ SyscallDesc("sys_epoll_wait", unimplementedFunc),
896 /* 410 */ SyscallDesc("remap_file_pages", unimplementedFunc),
897 /* 411 */ SyscallDesc("set_tid_address", unimplementedFunc),
898 /* 412 */ SyscallDesc("restart_syscall", unimplementedFunc),
899 /* 413 */ SyscallDesc("fadvise64", unimplementedFunc),
900 /* 414 */ SyscallDesc("timer_create", unimplementedFunc),
901 /* 415 */ SyscallDesc("timer_settime", unimplementedFunc),
902 /* 416 */ SyscallDesc("timer_gettime", unimplementedFunc),
903 /* 417 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
904 /* 418 */ SyscallDesc("timer_delete", unimplementedFunc),
905 /* 419 */ SyscallDesc("clock_settime", unimplementedFunc),
906 /* 420 */ SyscallDesc("clock_gettime", unimplementedFunc),
907 /* 421 */ SyscallDesc("clock_getres", unimplementedFunc),
908 /* 422 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
909 /* 423 */ SyscallDesc("semtimedop", unimplementedFunc),
910 /* 424 */ SyscallDesc("tgkill", unimplementedFunc),
911 /* 425 */ SyscallDesc("stat64", unimplementedFunc),
912 /* 426 */ SyscallDesc("lstat64", lstat64Func<Linux>),
913 /* 427 */ SyscallDesc("fstat64", fstat64Func<Linux>),
914 /* 428 */ SyscallDesc("vserver", unimplementedFunc),
915 /* 429 */ SyscallDesc("mbind", unimplementedFunc),
916 /* 430 */ SyscallDesc("get_mempolicy", unimplementedFunc),
917 /* 431 */ SyscallDesc("set_mempolicy", unimplementedFunc),
918 /* 432 */ SyscallDesc("mq_open", unimplementedFunc),
919 /* 433 */ SyscallDesc("mq_unlink", unimplementedFunc),
920 /* 434 */ SyscallDesc("mq_timedsend", unimplementedFunc),
921 /* 435 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
922 /* 436 */ SyscallDesc("mq_notify", unimplementedFunc),
923 /* 437 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
924 /* 438 */ SyscallDesc("waitid", unimplementedFunc),
925 /* 439 */ SyscallDesc("add_key", unimplementedFunc),
926 /* 440 */ SyscallDesc("request_key", unimplementedFunc),
927 /* 441 */ SyscallDesc("keyctl", unimplementedFunc)
928 };
929
930 const int Linux::Num_Syscall_Descs =
931 sizeof(Linux::syscallDescs) / sizeof(SyscallDesc);
932
933 const int Linux::Max_Syscall_Desc = Linux::Num_Syscall_Descs - 1;
934
935
936 void
937 AlphaLinuxProcess::syscall(ExecContext *xc)
938 {
939 num_syscalls++;
940
941 int64_t callnum = xc->regs.intRegFile[ReturnValueReg];
942
943 Linux::doSyscall(callnum, this, xc);
944 }
945
946
947 AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name,
948 ObjectFile *objFile,
949 int stdin_fd,
950 int stdout_fd,
951 int stderr_fd,
952 std::vector<std::string> &argv,
953 std::vector<std::string> &envp)
954 : LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp)
955 {
956 init_regs->intRegFile[0] = 0;
957 }