process.cc revision 2665
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 * Authors: Steve Reinhardt
29 *          Gabe Black
30 *          Ali Saidi
31 */
32
33#include "arch/sparc/isa_traits.hh"
34#include "arch/sparc/linux/process.hh"
35#include "arch/sparc/regfile.hh"
36
37#include "base/trace.hh"
38#include "cpu/exec_context.hh"
39#include "kern/linux/linux.hh"
40
41#include "sim/process.hh"
42#include "sim/syscall_emul.hh"
43
44using namespace std;
45using namespace SparcISA;
46
47
48/// Target uname() handler.
49static SyscallReturn
50unameFunc(SyscallDesc *desc, int callnum, Process *process,
51          ExecContext *xc)
52{
53    TypedBufferArg<Linux::utsname> name(xc->getSyscallArg(0));
54
55    strcpy(name->sysname, "Linux");
56    strcpy(name->nodename, "m5.eecs.umich.edu");
57    strcpy(name->release, "2.4.20");
58    strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59    strcpy(name->machine, "sparc");
60
61    name.copyOut(xc->getMemPort());
62
63    return 0;
64}
65
66
67SyscallReturn SparcISA::getresuidFunc(SyscallDesc *desc, int num,
68                                         Process *p, ExecContext *xc)
69{
70    const IntReg id = htog(100);
71    Addr ruid = xc->getSyscallArg(0);
72    Addr euid = xc->getSyscallArg(1);
73    Addr suid = xc->getSyscallArg(2);
74    //Handle the EFAULT case
75    //Set the ruid
76    if(ruid)
77    {
78        BufferArg ruidBuff(ruid, sizeof(IntReg));
79        memcpy(ruidBuff.bufferPtr(), &id, sizeof(IntReg));
80        ruidBuff.copyOut(xc->getMemPort());
81    }
82    //Set the euid
83    if(euid)
84    {
85        BufferArg euidBuff(euid, sizeof(IntReg));
86        memcpy(euidBuff.bufferPtr(), &id, sizeof(IntReg));
87        euidBuff.copyOut(xc->getMemPort());
88    }
89    //Set the suid
90    if(suid)
91    {
92        BufferArg suidBuff(suid, sizeof(IntReg));
93        memcpy(suidBuff.bufferPtr(), &id, sizeof(IntReg));
94        suidBuff.copyOut(xc->getMemPort());
95    }
96    return 0;
97}
98
99SyscallDesc SparcLinuxProcess::syscallDescs[] = {
100    /*  0 */ SyscallDesc("restart_syscall", unimplementedFunc),
101    /*  1 */ SyscallDesc("exit", exitFunc),
102    /*  2 */ SyscallDesc("fork", unimplementedFunc),
103    /*  3 */ SyscallDesc("read", readFunc),
104    /*  4 */ SyscallDesc("write", writeFunc),
105    /*  5 */ SyscallDesc("open", openFunc<SparcLinux>),
106    /*  6 */ SyscallDesc("close", closeFunc),
107    /*  7 */ SyscallDesc("wait4", unimplementedFunc),
108    /*  8 */ SyscallDesc("creat", unimplementedFunc),
109    /*  9 */ SyscallDesc("link", unimplementedFunc),
110    /* 10 */ SyscallDesc("unlink", unlinkFunc),
111    /* 11 */ SyscallDesc("execv", unimplementedFunc),
112    /* 12 */ SyscallDesc("chdir", unimplementedFunc),
113    /* 13 */ SyscallDesc("chown", chownFunc),
114    /* 14 */ SyscallDesc("mknod", unimplementedFunc),
115    /* 15 */ SyscallDesc("chmod", chmodFunc<Linux>),
116    /* 16 */ SyscallDesc("lchown", unimplementedFunc),
117    /* 17 */ SyscallDesc("brk", obreakFunc),
118    /* 18 */ SyscallDesc("perfctr", unimplementedFunc),
119    /* 19 */ SyscallDesc("lseek", lseekFunc),
120    /* 20 */ SyscallDesc("getpid", getpidFunc),
121    /* 21 */ SyscallDesc("capget", unimplementedFunc),
122    /* 22 */ SyscallDesc("capset", unimplementedFunc),
123    /* 23 */ SyscallDesc("setuid", setuidFunc),
124    /* 24 */ SyscallDesc("getuid", getuidFunc),
125    /* 25 */ SyscallDesc("time", unimplementedFunc),
126    /* 26 */ SyscallDesc("ptrace", unimplementedFunc),
127    /* 27 */ SyscallDesc("alarm", unimplementedFunc),
128    /* 28 */ SyscallDesc("sigaltstack", unimplementedFunc),
129    /* 29 */ SyscallDesc("pause", unimplementedFunc),
130    /* 30 */ SyscallDesc("utime", unimplementedFunc),
131    /* 31 */ SyscallDesc("lchown32", unimplementedFunc),
132    /* 32 */ SyscallDesc("fchown32", unimplementedFunc),
133    /* 33 */ SyscallDesc("access", unimplementedFunc),
134    /* 34 */ SyscallDesc("nice", unimplementedFunc),
135    /* 35 */ SyscallDesc("chown32", unimplementedFunc),
136    /* 36 */ SyscallDesc("sync", unimplementedFunc),
137    /* 37 */ SyscallDesc("kill", unimplementedFunc),
138    /* 38 */ SyscallDesc("stat", unimplementedFunc),
139    /* 39 */ SyscallDesc("sendfile", unimplementedFunc),
140    /* 40 */ SyscallDesc("lstat", unimplementedFunc),
141    /* 41 */ SyscallDesc("dup", unimplementedFunc),
142    /* 42 */ SyscallDesc("pipe", pipePseudoFunc),
143    /* 43 */ SyscallDesc("times", unimplementedFunc),
144    /* 44 */ SyscallDesc("getuid32", unimplementedFunc),
145    /* 45 */ SyscallDesc("umount2", unimplementedFunc),
146    /* 46 */ SyscallDesc("setgid", unimplementedFunc),
147    /* 47 */ SyscallDesc("getgid", getgidFunc),
148    /* 48 */ SyscallDesc("signal", unimplementedFunc),
149    /* 49 */ SyscallDesc("geteuid", geteuidFunc),
150    /* 50 */ SyscallDesc("getegid", getegidFunc),
151    /* 51 */ SyscallDesc("acct", unimplementedFunc),
152    /* 52 */ SyscallDesc("memory_ordering", unimplementedFunc),
153    /* 53 */ SyscallDesc("getgid32", unimplementedFunc),
154    /* 54 */ SyscallDesc("ioctl", unimplementedFunc),
155    /* 55 */ SyscallDesc("reboot", unimplementedFunc),
156    /* 56 */ SyscallDesc("mmap2", unimplementedFunc),
157    /* 57 */ SyscallDesc("symlink", unimplementedFunc),
158    /* 58 */ SyscallDesc("readlink", unimplementedFunc),
159    /* 59 */ SyscallDesc("execve", unimplementedFunc),
160    /* 60 */ SyscallDesc("umask", unimplementedFunc),
161    /* 61 */ SyscallDesc("chroot", unimplementedFunc),
162    /* 62 */ SyscallDesc("fstat", fstatFunc<SparcLinux>),
163    /* 63 */ SyscallDesc("fstat64", unimplementedFunc),
164    /* 64 */ SyscallDesc("getpagesize", unimplementedFunc),
165    /* 65 */ SyscallDesc("msync", unimplementedFunc),
166    /* 66 */ SyscallDesc("vfork", unimplementedFunc),
167    /* 67 */ SyscallDesc("pread64", unimplementedFunc),
168    /* 68 */ SyscallDesc("pwrite64", unimplementedFunc),
169    /* 69 */ SyscallDesc("geteuid32", unimplementedFunc),
170    /* 70 */ SyscallDesc("getdgid32", unimplementedFunc),
171    /* 71 */ SyscallDesc("mmap", mmapFunc<SparcLinux>),
172    /* 72 */ SyscallDesc("setreuid32", unimplementedFunc),
173    /* 73 */ SyscallDesc("munmap", munmapFunc),
174    /* 74 */ SyscallDesc("mprotect", unimplementedFunc),
175    /* 75 */ SyscallDesc("madvise", unimplementedFunc),
176    /* 76 */ SyscallDesc("vhangup", unimplementedFunc),
177    /* 77 */ SyscallDesc("truncate64", unimplementedFunc),
178    /* 78 */ SyscallDesc("mincore", unimplementedFunc),
179    /* 79 */ SyscallDesc("getgroups", unimplementedFunc),
180    /* 80 */ SyscallDesc("setgroups", unimplementedFunc),
181    /* 81 */ SyscallDesc("getpgrp", unimplementedFunc),
182    /* 82 */ SyscallDesc("setgroups32", unimplementedFunc),
183    /* 83 */ SyscallDesc("setitimer", unimplementedFunc),
184    /* 84 */ SyscallDesc("ftruncate64", unimplementedFunc),
185    /* 85 */ SyscallDesc("swapon", unimplementedFunc),
186    /* 86 */ SyscallDesc("getitimer", unimplementedFunc),
187    /* 87 */ SyscallDesc("setuid32", unimplementedFunc),
188    /* 88 */ SyscallDesc("sethostname", unimplementedFunc),
189    /* 89 */ SyscallDesc("setgid32", unimplementedFunc),
190    /* 90 */ SyscallDesc("dup2", unimplementedFunc),
191    /* 91 */ SyscallDesc("setfsuid32", unimplementedFunc),
192    /* 92 */ SyscallDesc("fcntl", unimplementedFunc),
193    /* 93 */ SyscallDesc("select", unimplementedFunc),
194    /* 94 */ SyscallDesc("setfsgid32", unimplementedFunc),
195    /* 95 */ SyscallDesc("fsync", unimplementedFunc),
196    /* 96 */ SyscallDesc("setpriority", unimplementedFunc),
197    /* 97 */ SyscallDesc("socket", unimplementedFunc),
198    /* 98 */ SyscallDesc("connect", unimplementedFunc),
199    /* 99 */ SyscallDesc("accept", unimplementedFunc),
200    /* 100 */ SyscallDesc("getpriority", unimplementedFunc),
201    /* 101 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
202    /* 102 */ SyscallDesc("rt_sigaction", unimplementedFunc),
203    /* 103 */ SyscallDesc("rt_sigprocmask", unimplementedFunc),
204    /* 104 */ SyscallDesc("rt_sigpending", unimplementedFunc),
205    /* 105 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
206    /* 106 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc),
207    /* 107 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
208    /* 108 */ SyscallDesc("setresuid", unimplementedFunc),
209    /* 109 */ SyscallDesc("getresuid", getresuidFunc),
210    /* 110 */ SyscallDesc("setresgid", unimplementedFunc),
211    /* 111 */ SyscallDesc("getresgid", unimplementedFunc),
212    /* 112 */ SyscallDesc("setregid32", unimplementedFunc),
213    /* 113 */ SyscallDesc("recvmsg", unimplementedFunc),
214    /* 114 */ SyscallDesc("sendmsg", unimplementedFunc),
215    /* 115 */ SyscallDesc("getgroups32", unimplementedFunc),
216    /* 116 */ SyscallDesc("gettimeofday", unimplementedFunc),
217    /* 117 */ SyscallDesc("getrusage", unimplementedFunc),
218    /* 118 */ SyscallDesc("getsockopt", unimplementedFunc),
219    /* 119 */ SyscallDesc("getcwd", unimplementedFunc),
220    /* 120 */ SyscallDesc("readv", unimplementedFunc),
221    /* 121 */ SyscallDesc("writev", unimplementedFunc),
222    /* 122 */ SyscallDesc("settimeofday", unimplementedFunc),
223    /* 123 */ SyscallDesc("fchown", unimplementedFunc),
224    /* 124 */ SyscallDesc("fchmod", unimplementedFunc),
225    /* 125 */ SyscallDesc("recvfrom", unimplementedFunc),
226    /* 126 */ SyscallDesc("setreuid", unimplementedFunc),
227    /* 127 */ SyscallDesc("setregid", unimplementedFunc),
228    /* 128 */ SyscallDesc("rename", unimplementedFunc),
229    /* 129 */ SyscallDesc("truncate", unimplementedFunc),
230    /* 130 */ SyscallDesc("ftruncate", unimplementedFunc),
231    /* 131 */ SyscallDesc("flock", unimplementedFunc),
232    /* 132 */ SyscallDesc("lstat64", unimplementedFunc),
233    /* 133 */ SyscallDesc("sendto", unimplementedFunc),
234    /* 134 */ SyscallDesc("shutdown", unimplementedFunc),
235    /* 135 */ SyscallDesc("socketpair", unimplementedFunc),
236    /* 136 */ SyscallDesc("mkdir", unimplementedFunc),
237    /* 137 */ SyscallDesc("rmdir", unimplementedFunc),
238    /* 138 */ SyscallDesc("utimes", unimplementedFunc),
239    /* 139 */ SyscallDesc("stat64", unimplementedFunc),
240    /* 140 */ SyscallDesc("sendfile64", unimplementedFunc),
241    /* 141 */ SyscallDesc("getpeername", unimplementedFunc),
242    /* 142 */ SyscallDesc("futex", unimplementedFunc),
243    /* 143 */ SyscallDesc("gettid", unimplementedFunc),
244    /* 144 */ SyscallDesc("getrlimit", unimplementedFunc),
245    /* 145 */ SyscallDesc("setrlimit", unimplementedFunc),
246    /* 146 */ SyscallDesc("pivot_root", unimplementedFunc),
247    /* 147 */ SyscallDesc("prctl", unimplementedFunc),
248    /* 148 */ SyscallDesc("pciconfig_read", unimplementedFunc),
249    /* 149 */ SyscallDesc("pciconfig_write", unimplementedFunc),
250    /* 150 */ SyscallDesc("getsockname", unimplementedFunc),
251    /* 151 */ SyscallDesc("inotify_init", unimplementedFunc),
252    /* 152 */ SyscallDesc("inotify_add_watch", unimplementedFunc),
253    /* 153 */ SyscallDesc("poll", unimplementedFunc),
254    /* 154 */ SyscallDesc("getdents64", unimplementedFunc),
255    /* 155 */ SyscallDesc("fcntl64", unimplementedFunc),
256    /* 156 */ SyscallDesc("inotify_rm_watch", unimplementedFunc),
257    /* 157 */ SyscallDesc("statfs", unimplementedFunc),
258    /* 158 */ SyscallDesc("fstatfs", unimplementedFunc),
259    /* 159 */ SyscallDesc("umount", unimplementedFunc),
260    /* 160 */ SyscallDesc("sched_set_affinity", unimplementedFunc),
261    /* 161 */ SyscallDesc("sched_get_affinity", unimplementedFunc),
262    /* 162 */ SyscallDesc("getdomainname", unimplementedFunc),
263    /* 163 */ SyscallDesc("setdomainname", unimplementedFunc),
264    /* 164 */ SyscallDesc("utrap_install", unimplementedFunc),
265    /* 165 */ SyscallDesc("quotactl", unimplementedFunc),
266    /* 166 */ SyscallDesc("set_tid_address", unimplementedFunc),
267    /* 167 */ SyscallDesc("mount", unimplementedFunc),
268    /* 168 */ SyscallDesc("ustat", unimplementedFunc),
269    /* 169 */ SyscallDesc("setxattr", unimplementedFunc),
270    /* 170 */ SyscallDesc("lsetxattr", unimplementedFunc),
271    /* 171 */ SyscallDesc("fsetxattr", unimplementedFunc),
272    /* 172 */ SyscallDesc("getxattr", unimplementedFunc),
273    /* 173 */ SyscallDesc("lgetxattr", unimplementedFunc),
274    /* 174 */ SyscallDesc("getdents", unimplementedFunc),
275    /* 175 */ SyscallDesc("setsid", unimplementedFunc),
276    /* 176 */ SyscallDesc("fchdir", unimplementedFunc),
277    /* 177 */ SyscallDesc("fgetxattr", unimplementedFunc),
278    /* 178 */ SyscallDesc("listxattr", unimplementedFunc),
279    /* 179 */ SyscallDesc("llistxattr", unimplementedFunc),
280    /* 180 */ SyscallDesc("flistxattr", unimplementedFunc),
281    /* 181 */ SyscallDesc("removexattr", unimplementedFunc),
282    /* 182 */ SyscallDesc("lremovexattr", unimplementedFunc),
283    /* 183 */ SyscallDesc("sigpending", unimplementedFunc),
284    /* 184 */ SyscallDesc("query_module", unimplementedFunc),
285    /* 185 */ SyscallDesc("setpgid", unimplementedFunc),
286    /* 186 */ SyscallDesc("fremovexattr", unimplementedFunc),
287    /* 187 */ SyscallDesc("tkill", unimplementedFunc),
288    /* 188 */ SyscallDesc("exit_group", exitFunc),
289    /* 189 */ SyscallDesc("uname", unameFunc),
290    /* 190 */ SyscallDesc("init_module", unimplementedFunc),
291    /* 191 */ SyscallDesc("personality", unimplementedFunc),
292    /* 192 */ SyscallDesc("remap_file_pages", unimplementedFunc),
293    /* 193 */ SyscallDesc("epoll_create", unimplementedFunc),
294    /* 194 */ SyscallDesc("epoll_ctl", unimplementedFunc),
295    /* 195 */ SyscallDesc("epoll_wait", unimplementedFunc),
296    /* 196 */ SyscallDesc("ioprio_set", unimplementedFunc),
297    /* 197 */ SyscallDesc("getppid", getppidFunc),
298    /* 198 */ SyscallDesc("sigaction", unimplementedFunc),
299    /* 199 */ SyscallDesc("sgetmask", unimplementedFunc),
300    /* 200 */ SyscallDesc("ssetmask", unimplementedFunc),
301    /* 201 */ SyscallDesc("sigsuspend", unimplementedFunc),
302    /* 202 */ SyscallDesc("oldlstat", unimplementedFunc),
303    /* 203 */ SyscallDesc("uselib", unimplementedFunc),
304    /* 204 */ SyscallDesc("readdir", unimplementedFunc),
305    /* 205 */ SyscallDesc("readahead", unimplementedFunc),
306    /* 206 */ SyscallDesc("socketcall", unimplementedFunc),
307    /* 207 */ SyscallDesc("syslog", unimplementedFunc),
308    /* 208 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
309    /* 209 */ SyscallDesc("fadvise64", unimplementedFunc),
310    /* 210 */ SyscallDesc("fadvise64_64", unimplementedFunc),
311    /* 211 */ SyscallDesc("tgkill", unimplementedFunc),
312    /* 212 */ SyscallDesc("waitpid", unimplementedFunc),
313    /* 213 */ SyscallDesc("swapoff", unimplementedFunc),
314    /* 214 */ SyscallDesc("sysinfo", unimplementedFunc),
315    /* 215 */ SyscallDesc("ipc", unimplementedFunc),
316    /* 216 */ SyscallDesc("sigreturn", unimplementedFunc),
317    /* 217 */ SyscallDesc("clone", unimplementedFunc),
318    /* 218 */ SyscallDesc("ioprio_get", unimplementedFunc),
319    /* 219 */ SyscallDesc("adjtimex", unimplementedFunc),
320    /* 220 */ SyscallDesc("sigprocmask", unimplementedFunc),
321    /* 221 */ SyscallDesc("create_module", unimplementedFunc),
322    /* 222 */ SyscallDesc("delete_module", unimplementedFunc),
323    /* 223 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
324    /* 224 */ SyscallDesc("getpgid", unimplementedFunc),
325    /* 225 */ SyscallDesc("bdflush", unimplementedFunc),
326    /* 226 */ SyscallDesc("sysfs", unimplementedFunc),
327    /* 227 */ SyscallDesc("afs_syscall", unimplementedFunc),
328    /* 228 */ SyscallDesc("setfsuid", unimplementedFunc),
329    /* 229 */ SyscallDesc("setfsgid", unimplementedFunc),
330    /* 230 */ SyscallDesc("_newselect", unimplementedFunc),
331    /* 231 */ SyscallDesc("time", unimplementedFunc),
332    /* 232 */ SyscallDesc("oldstat", unimplementedFunc),
333    /* 233 */ SyscallDesc("stime", unimplementedFunc),
334    /* 234 */ SyscallDesc("statfs64", unimplementedFunc),
335    /* 235 */ SyscallDesc("fstatfs64", unimplementedFunc),
336    /* 236 */ SyscallDesc("_llseek", unimplementedFunc),
337    /* 237 */ SyscallDesc("mlock", unimplementedFunc),
338    /* 238 */ SyscallDesc("munlock", unimplementedFunc),
339    /* 239 */ SyscallDesc("mlockall", unimplementedFunc),
340    /* 240 */ SyscallDesc("munlockall", unimplementedFunc),
341    /* 241 */ SyscallDesc("sched_setparam", unimplementedFunc),
342    /* 242 */ SyscallDesc("sched_getparam", unimplementedFunc),
343    /* 243 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
344    /* 244 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
345    /* 245 */ SyscallDesc("sched_yield", unimplementedFunc),
346    /* 246 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
347    /* 247 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
348    /* 248 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
349    /* 249 */ SyscallDesc("nanosleep", unimplementedFunc),
350    /* 250 */ SyscallDesc("mremap", unimplementedFunc),
351    /* 251 */ SyscallDesc("_sysctl", unimplementedFunc),
352    /* 252 */ SyscallDesc("getsid", unimplementedFunc),
353    /* 253 */ SyscallDesc("fdatasync", unimplementedFunc),
354    /* 254 */ SyscallDesc("nfsservctl", unimplementedFunc),
355    /* 255 */ SyscallDesc("aplib", unimplementedFunc),
356    /* 256 */ SyscallDesc("clock_settime", unimplementedFunc),
357    /* 257 */ SyscallDesc("clock_gettime", unimplementedFunc),
358    /* 258 */ SyscallDesc("clock_getres", unimplementedFunc),
359    /* 259 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
360    /* 260 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
361    /* 261 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
362    /* 262 */ SyscallDesc("timer_settime", unimplementedFunc),
363    /* 263 */ SyscallDesc("timer_gettime", unimplementedFunc),
364    /* 264 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
365    /* 265 */ SyscallDesc("timer_delete", unimplementedFunc),
366    /* 266 */ SyscallDesc("timer_create", unimplementedFunc),
367    /* 267 */ SyscallDesc("vserver", unimplementedFunc),
368    /* 268 */ SyscallDesc("io_setup", unimplementedFunc),
369    /* 269 */ SyscallDesc("io_destroy", unimplementedFunc),
370    /* 270 */ SyscallDesc("io_submit", unimplementedFunc),
371    /* 271 */ SyscallDesc("io_cancel", unimplementedFunc),
372    /* 272 */ SyscallDesc("io_getevents", unimplementedFunc),
373    /* 273 */ SyscallDesc("mq_open", unimplementedFunc),
374    /* 274 */ SyscallDesc("mq_unlink", unimplementedFunc),
375    /* 275 */ SyscallDesc("mq_timedsend", unimplementedFunc),
376    /* 276 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
377    /* 277 */ SyscallDesc("mq_notify", unimplementedFunc),
378    /* 278 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
379    /* 279 */ SyscallDesc("waitid", unimplementedFunc),
380    /* 280 */ SyscallDesc("sys_setaltroot", unimplementedFunc),
381    /* 281 */ SyscallDesc("add_key", unimplementedFunc),
382    /* 282 */ SyscallDesc("request_key", unimplementedFunc),
383    /* 283 */ SyscallDesc("keyctl", unimplementedFunc)
384};
385
386SparcLinuxProcess::SparcLinuxProcess(const std::string &name,
387                                     ObjectFile *objFile,
388                                     System * system,
389                                     int stdin_fd,
390                                     int stdout_fd,
391                                     int stderr_fd,
392                                     std::vector<std::string> &argv,
393                                     std::vector<std::string> &envp)
394    : SparcLiveProcess(name, objFile, system,
395            stdin_fd, stdout_fd, stderr_fd, argv, envp),
396     Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
397{
398    // The sparc syscall table must be <= 284 entries because that is all there
399    // is space for.
400    assert(Num_Syscall_Descs <= 284);
401}
402
403
404
405SyscallDesc*
406SparcLinuxProcess::getDesc(int callnum)
407{
408    if (callnum < 0 || callnum > Num_Syscall_Descs)
409        return NULL;
410    return &syscallDescs[callnum];
411}
412