From 232134a8169e35931a34140c57dc7a8dfb4b1546 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 9 Mar 2005 15:52:10 -0500 Subject: 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 --- arch/alpha/isa_traits.hh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'arch/alpha/isa_traits.hh') 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 + SyscallReturn(T v, bool s) + { + retval = (uint64_t)v; + success = s; + } + + template + 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; -- cgit v1.2.3 From 9797eedeead30f93d9a34583197c4f11b341c04f Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 10 Mar 2005 02:01:43 -0500 Subject: fix typo in SyscallReturn Object --HG-- extra : convert_revision : 97d34a02a29a9ac3e2256d92194e3a46b9e8021e --- arch/alpha/isa_traits.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/alpha/isa_traits.hh') diff --git a/arch/alpha/isa_traits.hh b/arch/alpha/isa_traits.hh index 3208b0cb3..d9c1a506e 100644 --- a/arch/alpha/isa_traits.hh +++ b/arch/alpha/isa_traits.hh @@ -311,8 +311,8 @@ class SyscallReturn { return *this; } - uint64_t successful() { return success; } - bool value() { return retval; } + bool successful() { return success; } + uint64_t value() { return retval; } private: -- cgit v1.2.3