diff options
author | Korey Sewell <ksewell@umich.edu> | 2006-03-18 11:31:31 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2006-03-18 11:31:31 -0500 |
commit | e6bc492554408e89d7ced523c66991665126dc29 (patch) | |
tree | 009d6af8a24b4ce71f61629ae7930bc4fbf385e7 /arch | |
parent | 3883406a1ca42950f0eed3e2deebbd900e45fc9d (diff) | |
download | gem5-e6bc492554408e89d7ced523c66991665126dc29.tar.xz |
more syscall fixes
arch/mips/isa_traits.hh:
use syscall return function from alpha
arch/mips/linux_process.cc:
fix some syntax errors, map some functions to the desc. table
--HG--
extra : convert_revision : 75e8e8893b7d96bb4fc8e8eced53bd16c0a727d1
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/isa_traits.hh | 15 | ||||
-rw-r--r-- | arch/mips/linux_process.cc | 15 |
2 files changed, 21 insertions, 9 deletions
diff --git a/arch/mips/isa_traits.hh b/arch/mips/isa_traits.hh index 8363f42f3..a69d84842 100644 --- a/arch/mips/isa_traits.hh +++ b/arch/mips/isa_traits.hh @@ -589,7 +589,20 @@ extern const Addr PageOffset; static inline void setSyscallReturn(SyscallReturn return_value, RegFile *regs) { - regs->intRegFile[ReturnValueReg1] = 1; + // check for error condition. Alpha syscall convention is to + // indicate success/failure in reg a3 (r19) and put the + // return value itself in the standard return value reg (v0). + if (return_value.successful()) { + // no error + regs->intRegFile[ReturnValueReg1] = 0; + regs->intRegFile[ReturnValueReg2] = return_value.value(); + } else { + // got an error, return details + regs->intRegFile[ReturnValueReg1] = (IntReg) -1; + regs->intRegFile[ReturnValueReg2] = -return_value.value(); + } + + //regs->intRegFile[ReturnValueReg1] = (IntReg)return_value; //panic("Returning from syscall\n"); } diff --git a/arch/mips/linux_process.cc b/arch/mips/linux_process.cc index 91e9a56a1..f0045d474 100644 --- a/arch/mips/linux_process.cc +++ b/arch/mips/linux_process.cc @@ -26,7 +26,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "arch/mips/common_syscall_emul.hh" #include "arch/mips/linux_process.hh" #include "arch/mips/isa_traits.hh" @@ -162,11 +161,11 @@ SyscallDesc MipsLinuxProcess::syscallDescs[] = { /* 43 */ SyscallDesc("times", unimplementedFunc), /* 44 */ SyscallDesc("prof", unimplementedFunc), /* 45 */ SyscallDesc("brk", unimplementedFunc),/*openFunc<Linux>*/ - /* 46 */ SyscallDesc("setgid", setgidFunc), + /* 46 */ SyscallDesc("setgid", unimplementedFunc), /* 47 */ SyscallDesc("getgid", getgidFunc), /* 48 */ SyscallDesc("signal", ignoreFunc), - /* 49 */ SyscallDesc("geteuid", unimplementedFunc), - /* 50 */ SyscallDesc("getegid", unimplementedFunc), + /* 49 */ SyscallDesc("geteuid", geteuidFunc), + /* 50 */ SyscallDesc("getegid", getegidFunc), /* 51 */ SyscallDesc("acct", unimplementedFunc), /* 52 */ SyscallDesc("umount2", unimplementedFunc), /* 53 */ SyscallDesc("lock", unimplementedFunc), @@ -207,7 +206,7 @@ SyscallDesc MipsLinuxProcess::syscallDescs[] = { /* 88 */ SyscallDesc("reboot", unimplementedFunc), /* 89 */ SyscallDesc("readdir", unimplementedFunc), /* 90 */ SyscallDesc("mmap", mmapFunc<Linux>), - /* 91 */ SyscallDesc("munmap", ),/*fstatFunc<Linux>*/ + /* 91 */ SyscallDesc("munmap",unimplementedFunc),/*fstatFunc<Linux>*/ /* 92 */ SyscallDesc("truncate", fcntlFunc), /* 93 */ SyscallDesc("ftruncate", unimplementedFunc), /* 94 */ SyscallDesc("fchmod", unimplementedFunc), @@ -238,9 +237,9 @@ SyscallDesc MipsLinuxProcess::syscallDescs[] = { /* 119 */ SyscallDesc("sigreturn", unimplementedFunc), /* 120 */ SyscallDesc("clone", unimplementedFunc), /* 121 */ SyscallDesc("setdomainname", unimplementedFunc), - /* 122 */ SyscallDesc("uname", unameFunc)/*,writevFunc<Linux>*/ - /* 123 */ SyscallDesc("modify_ldt", fchownFunc), - /* 124 */ SyscallDesc("adjtimex", fchmodFunc<Linux>), + /* 122 */ SyscallDesc("uname", unameFunc),/*,writevFunc<Linux>*/ + /* 123 */ SyscallDesc("modify_ldt", unimplementedFunc), + /* 124 */ SyscallDesc("adjtimex", unimplementedFunc), /* 125 */ SyscallDesc("mprotect", unimplementedFunc), /* 126 */ SyscallDesc("sigprocmask", unimplementedFunc), /* 127 */ SyscallDesc("create_module", unimplementedFunc), |