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