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