diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/process.cc | 1 | ||||
-rw-r--r-- | sim/syscall_emul.cc | 12 | ||||
-rw-r--r-- | sim/syscall_emul.hh | 14 |
3 files changed, 13 insertions, 14 deletions
diff --git a/sim/process.cc b/sim/process.cc index 70a92a604..d5f97ee5f 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -46,7 +46,6 @@ #include "mem/memory.hh" #include "mem/translating_port.hh" #include "sim/builder.hh" -#include "sim/fake_syscall.hh" #include "sim/process.hh" #include "sim/stats.hh" #include "sim/syscall_emul.hh" diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc index faad733a8..6c24b6dc5 100644 --- a/sim/syscall_emul.cc +++ b/sim/syscall_emul.cc @@ -82,7 +82,7 @@ SyscallReturn exitFunc(SyscallDesc *desc, int callnum, Process *process, ExecContext *xc) { - new SimExitEvent("syscall caused exit", xc->getSyscallArg(0) & 0xff); + new SimExitEvent("target called exit()", xc->getSyscallArg(0) & 0xff); return 1; } @@ -193,7 +193,7 @@ unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return (TheISA::IntReg)-EFAULT; int result = unlink(path.c_str()); @@ -205,12 +205,12 @@ renameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string old_name; - if (xc->getMemPort()->readStringFunctional(old_name, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(old_name, xc->getSyscallArg(0))) return -EFAULT; string new_name; - if (xc->getMemPort()->readStringFunctional(new_name, xc->getSyscallArg(1)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(new_name, xc->getSyscallArg(1))) return -EFAULT; int64_t result = rename(old_name.c_str(), new_name.c_str()); @@ -222,7 +222,7 @@ truncateFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; off_t length = xc->getSyscallArg(1); @@ -250,7 +250,7 @@ chownFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; /* XXX endianess */ diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh index 8eacf9200..60e06b294 100644 --- a/sim/syscall_emul.hh +++ b/sim/syscall_emul.hh @@ -370,7 +370,7 @@ openFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; if (path == "/dev/sysdev0") { @@ -417,7 +417,7 @@ chmodFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; uint32_t mode = xc->getSyscallArg(1); @@ -470,7 +470,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; struct stat hostBuf; @@ -522,7 +522,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; struct stat hostBuf; @@ -544,7 +544,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; #if BSD_HOST @@ -596,7 +596,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; struct statfs hostBuf; @@ -770,7 +770,7 @@ utimesFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (!xc->getMemPort()->tryReadStringFunctional(path, xc->getSyscallArg(0))) return -EFAULT; TypedBufferArg<typename OS::timeval [2]> tp(xc->getSyscallArg(1)); |