syscall_emul.cc (10223:34f48d0dac97) | syscall_emul.cc (10253:00086092d9f7) |
---|---|
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; --- 41 unchanged lines hidden (view full) --- 50#include "sim/system.hh" 51 52using namespace std; 53using namespace TheISA; 54 55void 56SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc) 57{ | 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; --- 41 unchanged lines hidden (view full) --- 50#include "sim/system.hh" 51 52using namespace std; 53using namespace TheISA; 54 55void 56SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc) 57{ |
58#if TRACING_ON 59 int index = 0; 60#endif 61 DPRINTFR(SyscallVerbose, 62 "%d: %s: syscall %s called w/arguments %d,%d,%d,%d\n", 63 curTick(), tc->getCpuPtr()->name(), name, 64 process->getSyscallArg(tc, index), 65 process->getSyscallArg(tc, index), 66 process->getSyscallArg(tc, index), 67 process->getSyscallArg(tc, index)); | 58 if (DTRACE(SyscallVerbose)) { 59 int index = 0; 60 IntReg arg[4]; |
68 | 61 |
62 // we can't just put the calls to getSyscallArg() in the 63 // DPRINTF arg list, because C++ doesn't guarantee their order 64 for (int i = 0; i < 4; ++i) 65 arg[i] = process->getSyscallArg(tc, index); 66 67 DPRINTFNR("%d: %s: syscall %s called w/arguments %d,%d,%d,%d\n", 68 curTick(), tc->getCpuPtr()->name(), name, 69 arg[0], arg[1], arg[2], arg[3]); 70 } 71 |
|
69 SyscallReturn retval = (*funcPtr)(this, callnum, process, tc); 70 71 DPRINTFR(SyscallVerbose, "%d: %s: syscall %s returns %d\n", 72 curTick(), tc->getCpuPtr()->name(), name, retval.encodedValue()); 73 74 if (!(flags & SyscallDesc::SuppressReturnValue)) 75 process->setSyscallReturn(tc, retval); 76} --- 9 unchanged lines hidden (view full) --- 86} 87 88 89SyscallReturn 90ignoreFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 91 ThreadContext *tc) 92{ 93 int index = 0; | 72 SyscallReturn retval = (*funcPtr)(this, callnum, process, tc); 73 74 DPRINTFR(SyscallVerbose, "%d: %s: syscall %s returns %d\n", 75 curTick(), tc->getCpuPtr()->name(), name, retval.encodedValue()); 76 77 if (!(flags & SyscallDesc::SuppressReturnValue)) 78 process->setSyscallReturn(tc, retval); 79} --- 9 unchanged lines hidden (view full) --- 89} 90 91 92SyscallReturn 93ignoreFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 94 ThreadContext *tc) 95{ 96 int index = 0; |
94 warn("ignoring syscall %s(%d, %d, ...)", desc->name, 95 process->getSyscallArg(tc, index), process->getSyscallArg(tc, index)); | 97 warn("ignoring syscall %s(%d, ...)", desc->name, 98 process->getSyscallArg(tc, index)); |
96 97 return 0; 98} 99 100 101SyscallReturn 102ignoreWarnOnceFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 103 ThreadContext *tc) 104{ 105 int index = 0; | 99 100 return 0; 101} 102 103 104SyscallReturn 105ignoreWarnOnceFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 106 ThreadContext *tc) 107{ 108 int index = 0; |
106 warn_once("ignoring syscall %s(%d, %d, ...)", desc->name, 107 process->getSyscallArg(tc, index), process->getSyscallArg(tc, index)); | 109 warn_once("ignoring syscall %s(%d, ...)", desc->name, 110 process->getSyscallArg(tc, index)); |
108 109 return 0; 110} 111 112 113SyscallReturn 114exitFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 115 ThreadContext *tc) --- 768 unchanged lines hidden --- | 111 112 return 0; 113} 114 115 116SyscallReturn 117exitFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 118 ThreadContext *tc) --- 768 unchanged lines hidden --- |