syscalls.cc (14014:ce216ee5d886) | syscalls.cc (14024:abe47b13653d) |
---|---|
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; --- 37 unchanged lines hidden (view full) --- 46 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); 47 48 strcpy(name->sysname, "Linux"); 49 strcpy(name->nodename, "sim.gem5.org"); 50 strcpy(name->release, process->release.c_str()); 51 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 52 strcpy(name->machine, "sparc"); 53 | 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; --- 37 unchanged lines hidden (view full) --- 46 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); 47 48 strcpy(name->sysname, "Linux"); 49 strcpy(name->nodename, "sim.gem5.org"); 50 strcpy(name->release, process->release.c_str()); 51 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 52 strcpy(name->machine, "sparc"); 53 |
54 name.copyOut(tc->getMemProxy()); | 54 name.copyOut(tc->getVirtProxy()); |
55 56 return 0; 57} 58 59 60SyscallReturn 61getresuidFunc(SyscallDesc *desc, int num, ThreadContext *tc) 62{ 63 const uint64_t id = htog(100); 64 int index = 0; 65 auto p = tc->getProcessPtr(); 66 Addr ruid = p->getSyscallArg(tc, index); 67 Addr euid = p->getSyscallArg(tc, index); 68 Addr suid = p->getSyscallArg(tc, index); 69 // Handle the EFAULT case 70 // Set the ruid 71 if (ruid) { 72 BufferArg ruidBuff(ruid, sizeof(uint64_t)); 73 memcpy(ruidBuff.bufferPtr(), &id, sizeof(uint64_t)); | 55 56 return 0; 57} 58 59 60SyscallReturn 61getresuidFunc(SyscallDesc *desc, int num, ThreadContext *tc) 62{ 63 const uint64_t id = htog(100); 64 int index = 0; 65 auto p = tc->getProcessPtr(); 66 Addr ruid = p->getSyscallArg(tc, index); 67 Addr euid = p->getSyscallArg(tc, index); 68 Addr suid = p->getSyscallArg(tc, index); 69 // Handle the EFAULT case 70 // Set the ruid 71 if (ruid) { 72 BufferArg ruidBuff(ruid, sizeof(uint64_t)); 73 memcpy(ruidBuff.bufferPtr(), &id, sizeof(uint64_t)); |
74 ruidBuff.copyOut(tc->getMemProxy()); | 74 ruidBuff.copyOut(tc->getVirtProxy()); |
75 } 76 // Set the euid 77 if (euid) { 78 BufferArg euidBuff(euid, sizeof(uint64_t)); 79 memcpy(euidBuff.bufferPtr(), &id, sizeof(uint64_t)); | 75 } 76 // Set the euid 77 if (euid) { 78 BufferArg euidBuff(euid, sizeof(uint64_t)); 79 memcpy(euidBuff.bufferPtr(), &id, sizeof(uint64_t)); |
80 euidBuff.copyOut(tc->getMemProxy()); | 80 euidBuff.copyOut(tc->getVirtProxy()); |
81 } 82 // Set the suid 83 if (suid) { 84 BufferArg suidBuff(suid, sizeof(uint64_t)); 85 memcpy(suidBuff.bufferPtr(), &id, sizeof(uint64_t)); | 81 } 82 // Set the suid 83 if (suid) { 84 BufferArg suidBuff(suid, sizeof(uint64_t)); 85 memcpy(suidBuff.bufferPtr(), &id, sizeof(uint64_t)); |
86 suidBuff.copyOut(tc->getMemProxy()); | 86 suidBuff.copyOut(tc->getVirtProxy()); |
87 } 88 return 0; 89} 90 91SyscallDesc SparcLinuxProcess::syscall32Descs[] = { 92 /* 0 */ SyscallDesc("restart_syscall", unimplementedFunc), 93 /* 1 */ SyscallDesc("exit", exitFunc), // 32 bit 94 /* 2 */ SyscallDesc("fork", unimplementedFunc), --- 593 unchanged lines hidden --- | 87 } 88 return 0; 89} 90 91SyscallDesc SparcLinuxProcess::syscall32Descs[] = { 92 /* 0 */ SyscallDesc("restart_syscall", unimplementedFunc), 93 /* 1 */ SyscallDesc("exit", exitFunc), // 32 bit 94 /* 2 */ SyscallDesc("fork", unimplementedFunc), --- 593 unchanged lines hidden --- |