return 0;
}
-SyscallDescABI<DefaultSyscallABI> PowerLinuxProcess::syscallDescs[] = {
+SyscallDescABI<PowerProcess::SyscallABI> PowerLinuxProcess::syscallDescs[] = {
/* 0 */ { "syscall" },
/* 1 */ { "exit", exitFunc },
/* 2 */ { "fork" },
using Process::getSyscallArg;
/// Array of syscall descriptors, indexed by call number.
- static SyscallDescABI<DefaultSyscallABI> syscallDescs[];
+ static SyscallDescABI<SyscallABI> syscallDescs[];
const int Num_Syscall_Descs;
};
tc->setIntReg(INTREG_CR, cr);
tc->setIntReg(ReturnValueReg, sysret.encodedValue());
}
+
+const std::vector<int> PowerProcess::SyscallABI::ArgumentRegs = {
+ 3, 4, 5, 6, 7, 8
+};
#include "mem/page_table.hh"
#include "sim/process.hh"
+#include "sim/syscall_abi.hh"
class ObjectFile;
using Process::getSyscallArg;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;
+
+ struct SyscallABI : public GenericSyscallABI64
+ {
+ static const std::vector<int> ArgumentRegs;
+ };
+};
+
+namespace GuestABI
+{
+
+template <>
+struct Result<PowerProcess::SyscallABI, SyscallReturn>
+{
+ static void
+ store(ThreadContext *tc, const SyscallReturn &ret)
+ {
+ if (ret.suppressed() || ret.needsRetry())
+ return;
+
+ PowerISA::Cr cr = tc->readIntReg(PowerISA::INTREG_CR);
+ if (ret.successful()) {
+ cr.cr0.so = 0;
+ } else {
+ cr.cr0.so = 1;
+ }
+ tc->setIntReg(PowerISA::INTREG_CR, cr);
+ tc->setIntReg(PowerISA::ReturnValueReg, ret.encodedValue());
+ }
};
+} // namespace GuestABI
+
#endif // __POWER_PROCESS_HH__