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