diff options
Diffstat (limited to 'src/arch/arm')
-rw-r--r-- | src/arch/arm/fastmodel/iris/thread_context.hh | 2 | ||||
-rw-r--r-- | src/arch/arm/faults.cc | 9 | ||||
-rw-r--r-- | src/arch/arm/freebsd/process.cc | 12 | ||||
-rw-r--r-- | src/arch/arm/freebsd/process.hh | 3 | ||||
-rw-r--r-- | src/arch/arm/linux/process.cc | 12 | ||||
-rw-r--r-- | src/arch/arm/linux/process.hh | 3 |
6 files changed, 32 insertions, 9 deletions
diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh index c0f40d76c..d0e920e60 100644 --- a/src/arch/arm/fastmodel/iris/thread_context.hh +++ b/src/arch/arm/fastmodel/iris/thread_context.hh @@ -419,7 +419,7 @@ class ThreadContext : public ::ThreadContext } void - syscall(int64_t callnum, Fault *fault) override + syscall(Fault *fault) override { panic("%s not implemented.", __FUNCTION__); } diff --git a/src/arch/arm/faults.cc b/src/arch/arm/faults.cc index 85e9fa7e9..5a7b8e8ea 100644 --- a/src/arch/arm/faults.cc +++ b/src/arch/arm/faults.cc @@ -845,15 +845,8 @@ SupervisorCall::invoke(ThreadContext *tc, const StaticInstPtr &inst) // As of now, there isn't a 32 bit thumb version of this instruction. assert(!machInst.bigThumb); - uint32_t callNum; - CPSR cpsr = tc->readMiscReg(MISCREG_CPSR); - OperatingMode mode = (OperatingMode)(uint8_t)cpsr.mode; - if (opModeIs64(mode)) - callNum = tc->readIntReg(INTREG_X8); - else - callNum = tc->readIntReg(INTREG_R7); Fault fault; - tc->syscall(callNum, &fault); + tc->syscall(&fault); // Advance the PC since that won't happen automatically. PCState pc = tc->pcState(); diff --git a/src/arch/arm/freebsd/process.cc b/src/arch/arm/freebsd/process.cc index 901b2411b..a603777a1 100644 --- a/src/arch/arm/freebsd/process.cc +++ b/src/arch/arm/freebsd/process.cc @@ -1317,3 +1317,15 @@ ArmFreebsdProcess64::initState() ArmProcess64::initState(); // The 64 bit equivalent of the comm page would be set up here. } + +void +ArmFreebsdProcess32::syscall(ThreadContext *tc, Fault *fault) +{ + doSyscall(tc->readIntReg(INTREG_R7), tc, fault); +} + +void +ArmFreebsdProcess64::syscall(ThreadContext *tc, Fault *fault) +{ + doSyscall(tc->readIntReg(INTREG_X8), tc, fault); +} diff --git a/src/arch/arm/freebsd/process.hh b/src/arch/arm/freebsd/process.hh index 28504d7d8..5f4a89600 100644 --- a/src/arch/arm/freebsd/process.hh +++ b/src/arch/arm/freebsd/process.hh @@ -63,6 +63,8 @@ class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits void initState(); + void syscall(ThreadContext *tc, Fault *fault) override; + /// Explicitly import the otherwise hidden getSyscallArg using ArmProcess::getSyscallArg; @@ -80,6 +82,7 @@ class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits ObjectFile::Arch _arch); void initState(); + void syscall(ThreadContext *tc, Fault *fault) override; SyscallDesc* getDesc(int callnum); }; diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index d3d0e85be..bc41932b8 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -1777,3 +1777,15 @@ ArmLinuxProcess64::initState() ArmProcess64::initState(); // The 64 bit equivalent of the comm page would be set up here. } + +void +ArmLinuxProcess32::syscall(ThreadContext *tc, Fault *fault) +{ + doSyscall(tc->readIntReg(INTREG_R7), tc, fault); +} + +void +ArmLinuxProcess64::syscall(ThreadContext *tc, Fault *fault) +{ + doSyscall(tc->readIntReg(INTREG_X8), tc, fault); +} diff --git a/src/arch/arm/linux/process.hh b/src/arch/arm/linux/process.hh index d4b7ca7d3..8e2709fcd 100644 --- a/src/arch/arm/linux/process.hh +++ b/src/arch/arm/linux/process.hh @@ -73,6 +73,8 @@ class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits void initState(); + void syscall(ThreadContext *tc, Fault *fault) override; + /// Explicitly import the otherwise hidden getSyscallArg using ArmProcess::getSyscallArg; @@ -90,6 +92,7 @@ class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits ObjectFile::Arch _arch); void initState(); + void syscall(ThreadContext *tc, Fault *fault) override; SyscallDesc* getDesc(int callnum); }; |