syscalls.cc (6640:30d92d2b66a1) | syscalls.cc (6701:4842482e1bd1) |
---|---|
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; --- 27 unchanged lines hidden (view full) --- 36 37namespace SparcISA { 38 39/// Target uname() handler. 40static SyscallReturn 41unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 42 ThreadContext *tc) 43{ | 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; --- 27 unchanged lines hidden (view full) --- 36 37namespace SparcISA { 38 39/// Target uname() handler. 40static SyscallReturn 41unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 42 ThreadContext *tc) 43{ |
44 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, 0)); | 44 int index = 0; 45 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); |
45 46 strcpy(name->sysname, "Linux"); 47 strcpy(name->nodename, "m5.eecs.umich.edu"); 48 strcpy(name->release, "2.6.12-9-sparc64"); 49 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 50 strcpy(name->machine, "sparc"); 51 52 name.copyOut(tc->getMemPort()); 53 54 return 0; 55} 56 57 58SyscallReturn getresuidFunc(SyscallDesc *desc, int num, 59 LiveProcess *p, ThreadContext *tc) 60{ 61 const IntReg id = htog(100); | 46 47 strcpy(name->sysname, "Linux"); 48 strcpy(name->nodename, "m5.eecs.umich.edu"); 49 strcpy(name->release, "2.6.12-9-sparc64"); 50 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 51 strcpy(name->machine, "sparc"); 52 53 name.copyOut(tc->getMemPort()); 54 55 return 0; 56} 57 58 59SyscallReturn getresuidFunc(SyscallDesc *desc, int num, 60 LiveProcess *p, ThreadContext *tc) 61{ 62 const IntReg id = htog(100); |
62 Addr ruid = p->getSyscallArg(tc, 0); 63 Addr euid = p->getSyscallArg(tc, 1); 64 Addr suid = p->getSyscallArg(tc, 2); | 63 int index = 0; 64 Addr ruid = p->getSyscallArg(tc, index); 65 Addr euid = p->getSyscallArg(tc, index); 66 Addr suid = p->getSyscallArg(tc, index); |
65 //Handle the EFAULT case 66 //Set the ruid 67 if(ruid) 68 { 69 BufferArg ruidBuff(ruid, sizeof(IntReg)); 70 memcpy(ruidBuff.bufferPtr(), &id, sizeof(IntReg)); 71 ruidBuff.copyOut(tc->getMemPort()); 72 } --- 614 unchanged lines hidden --- | 67 //Handle the EFAULT case 68 //Set the ruid 69 if(ruid) 70 { 71 BufferArg ruidBuff(ruid, sizeof(IntReg)); 72 memcpy(ruidBuff.bufferPtr(), &id, sizeof(IntReg)); 73 ruidBuff.copyOut(tc->getMemPort()); 74 } --- 614 unchanged lines hidden --- |