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