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