process.cc revision 2209
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/// Target pipe() handler. Even though this is a generic Posix call, 45/// the Alpha return convention is funky, so that makes it 46/// Alpha-specific. 47SyscallReturn 48pipeFunc(SyscallDesc *desc, int callnum, Process *process, 49 ExecContext *xc) 50{ 51 int fds[2], sim_fds[2]; 52 int pipe_retval = pipe(fds); 53 54 if (pipe_retval < 0) { 55 // error 56 return pipe_retval; 57 } 58 59 sim_fds[0] = process->alloc_fd(fds[0]); 60 sim_fds[1] = process->alloc_fd(fds[1]); 61 62 // Alpha Linux convention for pipe() is that fd[0] is returned as 63 // the return value of the function, and fd[1] is returned in r20. 64 xc->regs.intRegFile[20] = sim_fds[1]; 65 return sim_fds[0]; 66} 67 68 69/// Target uname() handler. 70static SyscallReturn 71unameFunc(SyscallDesc *desc, int callnum, Process *process, 72 ExecContext *xc) 73{ 74 TypedBufferArg<Linux::utsname> name(xc->getSyscallArg(0)); 75 76 strcpy(name->sysname, "Linux"); 77 strcpy(name->nodename, "m5.eecs.umich.edu"); 78 strcpy(name->release, "2.4.20"); 79 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 80 strcpy(name->machine, "alpha"); 81 82 name.copyOut(xc->mem); 83 return 0; 84} 85 86/// Target osf_getsysyinfo() handler. Even though this call is 87/// borrowed from Tru64, the subcases that get used appear to be 88/// different in practice from those used by Tru64 processes. 89static SyscallReturn 90osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, 91 ExecContext *xc) 92{ 93 unsigned op = xc->getSyscallArg(0); 94 // unsigned nbytes = xc->getSyscallArg(2); 95 96 switch (op) { 97 98 case 45: { // GSI_IEEE_FP_CONTROL 99 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); 100 // I don't think this exactly matches the HW FPCR 101 *fpcr = 0; 102 fpcr.copyOut(xc->mem); 103 return 0; 104 } 105 106 default: 107 cerr << "osf_getsysinfo: unknown op " << op << endl; 108 abort(); 109 break; 110 } 111 112 return 1; 113} 114 115/// Target osf_setsysinfo() handler. 116static SyscallReturn 117osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, 118 ExecContext *xc) 119{ 120 unsigned op = xc->getSyscallArg(0); 121 // unsigned nbytes = xc->getSyscallArg(2); 122 123 switch (op) { 124 125 case 14: { // SSI_IEEE_FP_CONTROL 126 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); 127 // I don't think this exactly matches the HW FPCR 128 fpcr.copyIn(xc->mem); 129 DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): " 130 " setting FPCR to 0x%x\n", gtoh(*(uint64_t*)fpcr)); 131 return 0; 132 } 133 134 default: 135 cerr << "osf_setsysinfo: unknown op " << op << endl; 136 abort(); 137 break; 138 } 139 140 return 1; 141} 142 143SyscallDesc SparcLinuxProcess::syscallDescs[] = { 144 /* 0 */ SyscallDesc("restart_syscall", unimplimentedFunc); 145 /* 1 */ SyscallDesc("exit", unimplimentedFunc); 146 /* 2 */ SyscallDesc("fork", unimplimentedFunc); 147 /* 3 */ SyscallDesc("read", unimplimentedFunc); 148 /* 4 */ SyscallDesc("write", unimplimentedFunc); 149 /* 5 */ SyscallDesc("open", unimplimentedFunc); 150 /* 6 */ SyscallDesc("close", unimplimentedFunc); 151 /* 7 */ SyscallDesc("wait4", unimplimentedFunc); 152 /* 8 */ SyscallDesc("creat", unimplimentedFunc); 153 /* 9 */ SyscallDesc("link", unimplimentedFunc); 154 /* 10 */ SyscallDesc("unlink", unimplimentedFunc); 155 /* 11 */ SyscallDesc("execv", unimplimentedFunc); 156 /* 12 */ SyscallDesc("chdir", unimplimentedFunc); 157 /* 13 */ SyscallDesc("chown", unimplimentedFunc); 158 /* 14 */ SyscallDesc("mknod", unimplimentedFunc); 159 /* 15 */ SyscallDesc("chmod", unimplimentedFunc); 160 /* 16 */ SyscallDesc("lchown", unimplimentedFunc); 161 /* 17 */ SyscallDesc("brk", unimplimentedFunc); 162 /* 18 */ SyscallDesc("perfctr", unimplimentedFunc); 163 /* 19 */ SyscallDesc("lseek", unimplimentedFunc); 164 /* 20 */ SyscallDesc("getpid", unimplimentedFunc); 165 /* 21 */ SyscallDesc("capget", unimplimentedFunc); 166 /* 22 */ SyscallDesc("capset", unimplimentedFunc); 167 /* 23 */ SyscallDesc("setuid", unimplimentedFunc); 168 /* 24 */ SyscallDesc("getuid", unimplimentedFunc); 169 /* 25 */ SyscallDesc("time", unimplimentedFunc); 170 /* 26 */ SyscallDesc("ptrace", unimplimentedFunc); 171 /* 27 */ SyscallDesc("alarm", unimplimentedFunc); 172 /* 28 */ SyscallDesc("sigaltstack", unimplimentedFunc); 173 /* 29 */ SyscallDesc("pause", unimplimentedFunc); 174 /* 30 */ SyscallDesc("utime", unimplimentedFunc); 175 /* 31 */ SyscallDesc("lchown32", unimplimentedFunc); 176 /* 32 */ SyscallDesc("fchown32", unimplimentedFunc); 177 /* 33 */ SyscallDesc("access", unimplimentedFunc); 178 /* 34 */ SyscallDesc("nice", unimplimentedFunc); 179 /* 35 */ SyscallDesc("chown32", unimplimentedFunc); 180 /* 36 */ SyscallDesc("sync", unimplimentedFunc); 181 /* 37 */ SyscallDesc("kill", unimplimentedFunc); 182 /* 38 */ SyscallDesc("stat", unimplimentedFunc); 183 /* 39 */ SyscallDesc("sendfile", unimplimentedFunc); 184 /* 40 */ SyscallDesc("lstat", unimplimentedFunc); 185 /* 41 */ SyscallDesc("dup", unimplimentedFunc); 186 /* 42 */ SyscallDesc("pipe", unimplimentedFunc); 187 /* 43 */ SyscallDesc("times", unimplimentedFunc); 188 /* 44 */ SyscallDesc("getuid32", unimplimentedFunc); 189 /* 45 */ SyscallDesc("umount2", unimplimentedFunc); 190 /* 46 */ SyscallDesc("setgid", unimplimentedFunc); 191 /* 47 */ SyscallDesc("getgid", unimplimentedFunc); 192 /* 48 */ SyscallDesc("signal", unimplimentedFunc); 193 /* 49 */ SyscallDesc("geteuid", unimplimentedFunc); 194 /* 50 */ SyscallDesc("getegid", unimplimentedFunc); 195 /* 51 */ SyscallDesc("acct", unimplimentedFunc); 196 /* 52 */ SyscallDesc("memory_ordering", unimplimentedFunc); 197 /* 53 */ SyscallDesc("getgid32", unimplimentedFunc); 198 /* 54 */ SyscallDesc("ioctl", unimplimentedFunc); 199 /* 55 */ SyscallDesc("reboot", unimplimentedFunc); 200 /* 56 */ SyscallDesc("mmap2", unimplimentedFunc); 201 /* 57 */ SyscallDesc("symlink", unimplimentedFunc); 202 /* 58 */ SyscallDesc("readlink", unimplimentedFunc); 203 /* 59 */ SyscallDesc("execve", unimplimentedFunc); 204 /* 60 */ SyscallDesc("umask", unimplimentedFunc); 205 /* 61 */ SyscallDesc("chroot", unimplimentedFunc); 206 /* 62 */ SyscallDesc("fstat", unimplimentedFunc); 207 /* 63 */ SyscallDesc("fstat64", unimplimentedFunc); 208 /* 64 */ SyscallDesc("getpagesize", unimplimentedFunc); 209 /* 65 */ SyscallDesc("msync", unimplimentedFunc); 210 /* 66 */ SyscallDesc("vfork", unimplimentedFunc); 211 /* 67 */ SyscallDesc("pread64", unimplimentedFunc); 212 /* 68 */ SyscallDesc("pwrite64", unimplimentedFunc); 213 /* 69 */ SyscallDesc("geteuid32", unimplimentedFunc); 214 /* 70 */ SyscallDesc("getdgid32", unimplimentedFunc); 215 /* 71 */ SyscallDesc("mmap", unimplimentedFunc); 216 /* 72 */ SyscallDesc("setreuid32", unimplimentedFunc); 217 /* 73 */ SyscallDesc("munmap", unimplimentedFunc); 218 /* 74 */ SyscallDesc("mprotect", unimplimentedFunc); 219 /* 75 */ SyscallDesc("madvise", unimplimentedFunc); 220 /* 76 */ SyscallDesc("vhangup", unimplimentedFunc); 221 /* 77 */ SyscallDesc("truncate64", unimplimentedFunc); 222 /* 78 */ SyscallDesc("mincore", unimplimentedFunc); 223 /* 79 */ SyscallDesc("getgroups", unimplimentedFunc); 224 /* 80 */ SyscallDesc("setgroups", unimplimentedFunc); 225 /* 81 */ SyscallDesc("getpgrp", unimplimentedFunc); 226 /* 82 */ SyscallDesc("setgroups32", unimplimentedFunc); 227 /* 83 */ SyscallDesc("setitimer", unimplimentedFunc); 228 /* 84 */ SyscallDesc("ftruncate64", unimplimentedFunc); 229 /* 85 */ SyscallDesc("swapon", unimplimentedFunc); 230 /* 86 */ SyscallDesc("getitimer", unimplimentedFunc); 231 /* 87 */ SyscallDesc("setuid32", unimplimentedFunc); 232 /* 88 */ SyscallDesc("sethostname", unimplimentedFunc); 233 /* 89 */ SyscallDesc("setgid32", unimplimentedFunc); 234 /* 90 */ SyscallDesc("dup2", unimplimentedFunc); 235 /* 91 */ SyscallDesc("setfsuid32", unimplimentedFunc); 236 /* 92 */ SyscallDesc("fcntl", unimplimentedFunc); 237 /* 93 */ SyscallDesc("select", unimplimentedFunc); 238 /* 94 */ SyscallDesc("setfsgid32", unimplimentedFunc); 239 /* 95 */ SyscallDesc("fsync", unimplimentedFunc); 240 /* 96 */ SyscallDesc("setpriority", unimplimentedFunc); 241 /* 97 */ SyscallDesc("socket", unimplimentedFunc); 242 /* 98 */ SyscallDesc("connect", unimplimentedFunc); 243 /* 99 */ SyscallDesc("accept", unimplimentedFunc); 244 /* 100 */ SyscallDesc("getpriority", unimplimentedFunc); 245 /* 101 */ SyscallDesc("rt_sigreturn", unimplimentedFunc); 246 /* 102 */ SyscallDesc("rt_sigaction", unimplimentedFunc); 247 /* 103 */ SyscallDesc("rt_sigprocmask", unimplimentedFunc); 248 /* 104 */ SyscallDesc("rt_sigpending", unimplimentedFunc); 249 /* 105 */ SyscallDesc("rt_sigtimedwait", unimplimentedFunc); 250 /* 106 */ SyscallDesc("rt_sigqueueinfo", unimplimentedFunc); 251 /* 107 */ SyscallDesc("rt_sigsuspend", unimplimentedFunc); 252 /* 108 */ SyscallDesc("setresuid", unimplimentedFunc); 253 /* 109 */ SyscallDesc("getresuid", unimplimentedFunc); 254 /* 110 */ SyscallDesc("setresgid", unimplimentedFunc); 255 /* 111 */ SyscallDesc("getresgid", unimplimentedFunc); 256 /* 112 */ SyscallDesc("setregid32", unimplimentedFunc); 257 /* 113 */ SyscallDesc("recvmsg", unimplimentedFunc); 258 /* 114 */ SyscallDesc("sendmsg", unimplimentedFunc); 259 /* 115 */ SyscallDesc("getgroups32", unimplimentedFunc); 260 /* 116 */ SyscallDesc("gettimeofday", unimplimentedFunc); 261 /* 117 */ SyscallDesc("getrusage", unimplimentedFunc); 262 /* 118 */ SyscallDesc("getsockopt", unimplimentedFunc); 263 /* 119 */ SyscallDesc("getcwd", unimplimentedFunc); 264 /* 120 */ SyscallDesc("readv", unimplimentedFunc); 265 /* 121 */ SyscallDesc("writev", unimplimentedFunc); 266 /* 122 */ SyscallDesc("settimeofday", unimplimentedFunc); 267 /* 123 */ SyscallDesc("fchown", unimplimentedFunc); 268 /* 124 */ SyscallDesc("fchmod", unimplimentedFunc); 269 /* 125 */ SyscallDesc("recvfrom", unimplimentedFunc); 270 /* 126 */ SyscallDesc("setreuid", unimplimentedFunc); 271 /* 127 */ SyscallDesc("setregid", unimplimentedFunc); 272 /* 128 */ SyscallDesc("rename", unimplimentedFunc); 273 /* 129 */ SyscallDesc("truncate", unimplimentedFunc); 274 /* 130 */ SyscallDesc("ftruncate", unimplimentedFunc); 275 /* 131 */ SyscallDesc("flock", unimplimentedFunc); 276 /* 132 */ SyscallDesc("lstat64", unimplimentedFunc); 277 /* 133 */ SyscallDesc("sendto", unimplimentedFunc); 278 /* 134 */ SyscallDesc("shutdown", unimplimentedFunc); 279 /* 135 */ SyscallDesc("socketpair", unimplimentedFunc); 280 /* 136 */ SyscallDesc("mkdir", unimplimentedFunc); 281 /* 137 */ SyscallDesc("rmdir", unimplimentedFunc); 282 /* 138 */ SyscallDesc("utimes", unimplimentedFunc); 283 /* 139 */ SyscallDesc("stat64", unimplimentedFunc); 284 /* 140 */ SyscallDesc("sendfile64", unimplimentedFunc); 285 /* 141 */ SyscallDesc("getpeername", unimplimentedFunc); 286 /* 142 */ SyscallDesc("futex", unimplimentedFunc); 287 /* 143 */ SyscallDesc("gettid", unimplimentedFunc); 288 /* 144 */ SyscallDesc("getrlimit", unimplimentedFunc); 289 /* 145 */ SyscallDesc("setrlimit", unimplimentedFunc); 290 /* 146 */ SyscallDesc("pivot_root", unimplimentedFunc); 291 /* 147 */ SyscallDesc("prctl", unimplimentedFunc); 292 /* 148 */ SyscallDesc("pciconfig_read", unimplimentedFunc); 293 /* 149 */ SyscallDesc("pciconfig_write", unimplimentedFunc); 294 /* 150 */ SyscallDesc("getsockname", unimplimentedFunc); 295 /* 151 */ SyscallDesc("inotify_init", unimplimentedFunc); 296 /* 152 */ SyscallDesc("inotify_add_watch", unimplimentedFunc); 297 /* 153 */ SyscallDesc("poll", unimplimentedFunc); 298 /* 154 */ SyscallDesc("getdents64", unimplimentedFunc); 299 /* 155 */ SyscallDesc("fcntl64", unimplimentedFunc); 300 /* 156 */ SyscallDesc("inotify_rm_watch", unimplimentedFunc); 301 /* 157 */ SyscallDesc("statfs", unimplimentedFunc); 302 /* 158 */ SyscallDesc("fstatfs", unimplimentedFunc); 303 /* 159 */ SyscallDesc("umount", unimplimentedFunc); 304 /* 160 */ SyscallDesc("sched_set_affinity", unimplimentedFunc); 305 /* 161 */ SyscallDesc("sched_get_affinity", unimplimentedFunc); 306 /* 162 */ SyscallDesc("getdomainname", unimplimentedFunc); 307 /* 163 */ SyscallDesc("setdomainname", unimplimentedFunc); 308 /* 164 */ SyscallDesc("utrap_install", unimplimentedFunc); 309 /* 165 */ SyscallDesc("quotactl", unimplimentedFunc); 310 /* 166 */ SyscallDesc("set_tid_address", unimplimentedFunc); 311 /* 167 */ SyscallDesc("mount", unimplimentedFunc); 312 /* 168 */ SyscallDesc("ustat", unimplimentedFunc); 313 /* 169 */ SyscallDesc("setxattr", unimplimentedFunc); 314 /* 170 */ SyscallDesc("lsetxattr", unimplimentedFunc); 315 /* 171 */ SyscallDesc("fsetxattr", unimplimentedFunc); 316 /* 172 */ SyscallDesc("getxattr", unimplimentedFunc); 317 /* 173 */ SyscallDesc("lgetxattr", unimplimentedFunc); 318 /* 174 */ SyscallDesc("getdents", unimplimentedFunc); 319 /* 175 */ SyscallDesc("setsid", unimplimentedFunc); 320 /* 176 */ SyscallDesc("fchdir", unimplimentedFunc); 321 /* 177 */ SyscallDesc("fgetxattr", unimplimentedFunc); 322 /* 178 */ SyscallDesc("listxattr", unimplimentedFunc); 323 /* 179 */ SyscallDesc("llistxattr", unimplimentedFunc); 324 /* 180 */ SyscallDesc("flistxattr", unimplimentedFunc); 325 /* 181 */ SyscallDesc("removexattr", unimplimentedFunc); 326 /* 182 */ SyscallDesc("lremovexattr", unimplimentedFunc); 327 /* 183 */ SyscallDesc("sigpending", unimplimentedFunc); 328 /* 184 */ SyscallDesc("query_module", unimplimentedFunc); 329 /* 185 */ SyscallDesc("setpgid", unimplimentedFunc); 330 /* 186 */ SyscallDesc("fremovexattr", unimplimentedFunc); 331 /* 187 */ SyscallDesc("tkill", unimplimentedFunc); 332 /* 188 */ SyscallDesc("exit_group", unimplimentedFunc); 333 /* 189 */ SyscallDesc("uname", unimplimentedFunc); 334 /* 190 */ SyscallDesc("init_module", unimplimentedFunc); 335 /* 191 */ SyscallDesc("personality", unimplimentedFunc); 336 /* 192 */ SyscallDesc("remap_file_pages", unimplimentedFunc); 337 /* 193 */ SyscallDesc("epoll_create", unimplimentedFunc); 338 /* 194 */ SyscallDesc("epoll_ctl", unimplimentedFunc); 339 /* 195 */ SyscallDesc("epoll_wait", unimplimentedFunc); 340 /* 196 */ SyscallDesc("ioprio_set", unimplimentedFunc); 341 /* 197 */ SyscallDesc("getppid", unimplimentedFunc); 342 /* 198 */ SyscallDesc("sigaction", unimplimentedFunc); 343 /* 199 */ SyscallDesc("sgetmask", unimplimentedFunc); 344 /* 200 */ SyscallDesc("ssetmask", unimplimentedFunc); 345 /* 201 */ SyscallDesc("sigsuspend", unimplimentedFunc); 346 /* 202 */ SyscallDesc("oldlstat", unimplimentedFunc); 347 /* 203 */ SyscallDesc("uselib", unimplimentedFunc); 348 /* 204 */ SyscallDesc("readdir", unimplimentedFunc); 349 /* 205 */ SyscallDesc("readahead", unimplimentedFunc); 350 /* 206 */ SyscallDesc("socketcall", unimplimentedFunc); 351 /* 207 */ SyscallDesc("syslog", unimplimentedFunc); 352 /* 208 */ SyscallDesc("lookup_dcookie", unimplimentedFunc); 353 /* 209 */ SyscallDesc("fadvise64", unimplimentedFunc); 354 /* 210 */ SyscallDesc("fadvise64_64", unimplimentedFunc); 355 /* 211 */ SyscallDesc("tgkill", unimplimentedFunc); 356 /* 212 */ SyscallDesc("waitpid", unimplimentedFunc); 357 /* 213 */ SyscallDesc("swapoff", unimplimentedFunc); 358 /* 214 */ SyscallDesc("sysinfo", unimplimentedFunc); 359 /* 215 */ SyscallDesc("ipc", unimplimentedFunc); 360 /* 216 */ SyscallDesc("sigreturn", unimplimentedFunc); 361 /* 217 */ SyscallDesc("clone", unimplimentedFunc); 362 /* 218 */ SyscallDesc("ioprio_get", unimplimentedFunc); 363 /* 219 */ SyscallDesc("adjtimex", unimplimentedFunc); 364 /* 220 */ SyscallDesc("sigprocmask", unimplimentedFunc); 365 /* 221 */ SyscallDesc("create_module", unimplimentedFunc); 366 /* 222 */ SyscallDesc("delete_module", unimplimentedFunc); 367 /* 223 */ SyscallDesc("get_kernel_syms", unimplimentedFunc); 368 /* 224 */ SyscallDesc("getpgid", unimplimentedFunc); 369 /* 225 */ SyscallDesc("bdflush", unimplimentedFunc); 370 /* 226 */ SyscallDesc("sysfs", unimplimentedFunc); 371 /* 227 */ SyscallDesc("afs_syscall", unimplimentedFunc); 372 /* 228 */ SyscallDesc("setfsuid", unimplimentedFunc); 373 /* 229 */ SyscallDesc("setfsgid", unimplimentedFunc); 374 /* 230 */ SyscallDesc("_newselect", unimplimentedFunc); 375 /* 231 */ SyscallDesc("time", unimplimentedFunc); 376 /* 232 */ SyscallDesc("oldstat", unimplimentedFunc); 377 /* 233 */ SyscallDesc("stime", unimplimentedFunc); 378 /* 234 */ SyscallDesc("statfs64", unimplimentedFunc); 379 /* 235 */ SyscallDesc("fstatfs64", unimplimentedFunc); 380 /* 236 */ SyscallDesc("_llseek", unimplimentedFunc); 381 /* 237 */ SyscallDesc("mlock", unimplimentedFunc); 382 /* 238 */ SyscallDesc("munlock", unimplimentedFunc); 383 /* 239 */ SyscallDesc("mlockall", unimplimentedFunc); 384 /* 240 */ SyscallDesc("munlockall", unimplimentedFunc); 385 /* 241 */ SyscallDesc("sched_setparam", unimplimentedFunc); 386 /* 242 */ SyscallDesc("sched_getparam", unimplimentedFunc); 387 /* 243 */ SyscallDesc("sched_setscheduler", unimplimentedFunc); 388 /* 244 */ SyscallDesc("sched_getscheduler", unimplimentedFunc); 389 /* 245 */ SyscallDesc("sched_yield", unimplimentedFunc); 390 /* 246 */ SyscallDesc("sched_get_priority_max", unimplimented); 391 /* 247 */ SyscallDesc("sched_get_priority_min", unimplimented); 392 /* 248 */ SyscallDesc("sched_rr_get_interval", unimplimented); 393 /* 249 */ SyscallDesc("nanosleep", unimplimentedFunc); 394 /* 250 */ SyscallDesc("mremap", unimplimentedFunc); 395 /* 251 */ SyscallDesc("_sysctl", unimplimentedFunc); 396 /* 252 */ SyscallDesc("getsid", unimplimentedFunc); 397 /* 253 */ SyscallDesc("fdatasync", unimplimentedFunc); 398 /* 254 */ SyscallDesc("nfsservctl", unimplimentedFunc); 399 /* 255 */ SyscallDesc("aplib", unimplimentedFunc); 400 /* 256 */ SyscallDesc("clock_settime", unimplimentedFunc); 401 /* 257 */ SyscallDesc("clock_gettime", unimplimentedFunc); 402 /* 258 */ SyscallDesc("clock_getres", unimplimentedFunc); 403 /* 259 */ SyscallDesc("clock_nanosleep", unimplimentedFunc); 404 /* 260 */ SyscallDesc("sched_getaffinity", unimplimentedFunc); 405 /* 261 */ SyscallDesc("sched_setaffinity", unimplimentedFunc); 406 /* 262 */ SyscallDesc("timer_settime", unimplimentedFunc); 407 /* 263 */ SyscallDesc("timer_gettime", unimplimentedFunc); 408 /* 264 */ SyscallDesc("timer_getoverrun", unimplimentedFunc); 409 /* 265 */ SyscallDesc("timer_delete", unimplimentedFunc); 410 /* 266 */ SyscallDesc("timer_create", unimplimentedFunc); 411 /* 267 */ SyscallDesc("vserver", unimplimentedFunc); 412 /* 268 */ SyscallDesc("io_setup", unimplimentedFunc); 413 /* 269 */ SyscallDesc("io_destroy", unimplimentedFunc); 414 /* 270 */ SyscallDesc("io_submit", unimplimentedFunc); 415 /* 271 */ SyscallDesc("io_cancel", unimplimentedFunc); 416 /* 272 */ SyscallDesc("io_getevents", unimplimentedFunc); 417 /* 273 */ SyscallDesc("mq_open", unimplimentedFunc); 418 /* 274 */ SyscallDesc("mq_unlink", unimplimentedFunc); 419 /* 275 */ SyscallDesc("mq_timedsend", unimplimentedFunc); 420 /* 276 */ SyscallDesc("mq_timedreceive", unimplimentedFunc); 421 /* 277 */ SyscallDesc("mq_notify", unimplimentedFunc); 422 /* 278 */ SyscallDesc("mq_getsetattr", unimplimentedFunc); 423 /* 279 */ SyscallDesc("waitid", unimplimentedFunc); 424 /* 280 */ SyscallDesc("sys_setaltroot", unimplimentedFunc); 425 /* 281 */ SyscallDesc("add_key", unimplimentedFunc); 426 /* 282 */ SyscallDesc("request_key", unimplimentedFunc); 427 /* 283 */ SyscallDesc("keyctl", unimplimentedFunc); 428}; 429 430SparcLinuxProcess::SparcLinuxProcess(const std::string &name, 431 ObjectFile *objFile, 432 int stdin_fd, 433 int stdout_fd, 434 int stderr_fd, 435 std::vector<std::string> &argv, 436 std::vector<std::string> &envp) 437 : LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp), 438 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) 439{ 440 init_regs->intRegFile[0] = 0; 441} 442 443 444 445SyscallDesc* 446AlphaLinuxProcess::getDesc(int callnum) 447{ 448 if (callnum < 0 || callnum > Num_Syscall_Descs) 449 return NULL; 450 return &syscallDescs[callnum]; 451} 452