SyscallReturn retval = (*funcPtr)(this, callnum, process, tc);
- DPRINTFR(SyscallVerbose, "%d: %s: syscall %s returns %d\n",
- curTick(), tc->getCpuPtr()->name(), name, retval.encodedValue());
+ if (retval.needsRetry()) {
+ DPRINTFS(SyscallVerbose, tc->getCpuPtr(), "syscall %s needs retry\n",
+ name);
+ } else {
+ DPRINTFS(SyscallVerbose, tc->getCpuPtr(), "syscall %s returns %d\n",
+ name, retval.encodedValue());
+ }
- if (!(flags & SyscallDesc::SuppressReturnValue))
+ if (!(flags & SyscallDesc::SuppressReturnValue) && !retval.needsRetry())
process->setSyscallReturn(tc, retval);
}
/// value is expected, e.g., as the return value from a system
/// call emulation function ('return 0;' or 'return -EFAULT;').
SyscallReturn(int64_t v)
- : value(v)
+ : value(v), retryFlag(false)
{}
+ /// Pseudo-constructor to create an instance with the retry flag set.
+ static SyscallReturn retry()
+ {
+ SyscallReturn s(0);
+ s.retryFlag = true;
+ return s;
+ }
+
~SyscallReturn() {}
/// Was the system call successful?
return (value >= 0 || value <= -4096);
}
+ /// Does the syscall need to be retried?
+ bool needsRetry() const { return retryFlag; }
+
/// The return value
int64_t returnValue() const
{
private:
int64_t value;
+
+ bool retryFlag;
};
#endif