diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2005-03-09 15:52:10 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2005-03-09 15:52:10 -0500 |
commit | 232134a8169e35931a34140c57dc7a8dfb4b1546 (patch) | |
tree | c178f1b301ee284d81522ecc14ac40f927a0df13 /arch/alpha/isa_traits.hh | |
parent | 761d104f7b5771ad7c854a6e6474c30ce55e217e (diff) | |
download | gem5-232134a8169e35931a34140c57dc7a8dfb4b1546.tar.xz |
Changed all syscalls to use syscall return object.
arch/alpha/alpha_linux_process.cc:
arch/alpha/alpha_tru64_process.cc:
cpu/exec_context.hh:
sim/process.hh:
sim/syscall_emul.cc:
sim/syscall_emul.hh:
Changed all syscalls to use syscall return object
arch/alpha/isa_traits.hh:
Added syscall return object that packages return value and return
status into an object.
sim/process.cc:
renamed variable name to nm so base class function name() can be called
--HG--
extra : convert_revision : 6609c5ffecc9e3519d7a0cd160879fd21d54abfc
Diffstat (limited to 'arch/alpha/isa_traits.hh')
-rw-r--r-- | arch/alpha/isa_traits.hh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/alpha/isa_traits.hh b/arch/alpha/isa_traits.hh index 8db8c6994..3208b0cb3 100644 --- a/arch/alpha/isa_traits.hh +++ b/arch/alpha/isa_traits.hh @@ -286,6 +286,43 @@ const int ArgumentReg1 = TheISA::ArgumentReg1; const int BranchPredAddrShiftAmt = TheISA::BranchPredAddrShiftAmt; const int MaxAddr = (Addr)-1; +#ifndef FULL_SYSTEM +class SyscallReturn { + public: + template <class T> + SyscallReturn(T v, bool s) + { + retval = (uint64_t)v; + success = s; + } + + template <class T> + SyscallReturn(T v) + { + success = (v >= 0); + retval = (uint64_t)v; + } + + ~SyscallReturn() {} + + SyscallReturn& operator=(const SyscallReturn& s) { + retval = s.retval; + success = s.success; + return *this; + } + + uint64_t successful() { return success; } + bool value() { return retval; } + + + private: + uint64_t retval; + bool success; +}; + +#endif + + #ifdef FULL_SYSTEM typedef TheISA::InternalProcReg InternalProcReg; const int NumInternalProcRegs = TheISA::NumInternalProcRegs; |