sim,arch: Collapse the ISA specific versions of m5Syscall.

The x86 version doesn't do anything x86 specific, and so can be used
generically in sim/pseudo_inst.(hh|cc)

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I46c2a7d326bd7a95daa8611888051c180e92e446
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23177
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2019-11-25 02:26:51 -08:00
parent cb3457ccd1
commit 390a74f599
12 changed files with 49 additions and 67 deletions

View File

@@ -32,14 +32,13 @@
#define __ARCH_ALPHA_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace AlphaISA
{
namespace AlphaISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace AlphaISA
#endif // __ARCH_ALPHA_PSEUDO_INST_HH__

View File

@@ -32,14 +32,13 @@
#define __ARCH_ARM_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace ArmISA
{
namespace ArmISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace ArmISA
#endif // __ARCH_ARM_PSEUDO_INST_HH__

View File

@@ -36,12 +36,6 @@ class ThreadContext;
using namespace GenericISA;
void
GenericISA::m5Syscall(ThreadContext *tc)
{
panic("m5Syscall not implemented for current ISA");
}
void
GenericISA::m5PageFault(ThreadContext *tc)
{

View File

@@ -35,13 +35,6 @@ class ThreadContext;
namespace GenericISA {
/*
* This function is executed when the simulation is executing the syscall
* handler in System Emulation mode.
*/
void
m5Syscall(ThreadContext *tc);
/*
* This function is executed when the simulation is executing the pagefault
* handler in System Emulation mode.

View File

@@ -32,14 +32,13 @@
#define __ARCH_MIPS_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace MipsISA
{
namespace MipsISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace MipsISA
#endif // __ARCH_MIPS_PSEUDO_INST_HH__

View File

@@ -32,14 +32,13 @@
#define __ARCH_POWER_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace PowerISA
{
namespace PowerISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace PowerISA
#endif // __ARCH_POWER_PSEUDO_INST_HH__

View File

@@ -32,14 +32,12 @@
#define __ARCH_RISCV_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace RiscvISA
{
namespace RiscvISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace RiscvISA
#endif // __ARCH_RISCV_PSEUDO_INST_HH__

View File

@@ -32,14 +32,13 @@
#define __ARCH_SPARC_PSEUDO_INST_HH__
#include "arch/generic/pseudo_inst.hh"
#include "base/logging.hh"
class ThreadContext;
namespace SparcISA
{
namespace SparcISA {
using GenericISA::m5Syscall;
using GenericISA::m5PageFault;
}
using GenericISA::m5PageFault;
} // namespace SparcISA
#endif // __ARCH_SPARC_PSEUDO_INST_HH__

View File

@@ -40,19 +40,6 @@ using namespace X86ISA;
namespace X86ISA {
/*
* This function is executed when the simulation is executing the syscall
* handler in System Emulation mode.
*/
void
m5Syscall(ThreadContext *tc)
{
DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
Fault fault;
tc->syscall(&fault);
}
/*
* This function is executed when the simulation is executing the pagefault
* handler in System Emulation mode.

View File

@@ -33,9 +33,11 @@
class ThreadContext;
namespace X86ISA {
void m5Syscall(ThreadContext *tc);
void m5PageFault(ThreadContext *tc);
}
namespace X86ISA
{
void m5PageFault(ThreadContext *tc);
} // namespace X86ISA
#endif // __ARCH_X86_PSEUDO_INST_HH__

View File

@@ -586,6 +586,18 @@ switchcpu(ThreadContext *tc)
exitSimLoop("switchcpu");
}
/*
* This function is executed when the simulation is executing the syscall
* handler in System Emulation mode.
*/
void
m5Syscall(ThreadContext *tc)
{
DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
Fault fault;
tc->syscall(&fault);
}
void
togglesync(ThreadContext *tc)
{

View File

@@ -88,6 +88,7 @@ void debugbreak(ThreadContext *tc);
void switchcpu(ThreadContext *tc);
void workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid);
void workend(ThreadContext *tc, uint64_t workid, uint64_t threadid);
void m5Syscall(ThreadContext *tc);
void togglesync(ThreadContext *tc);
} // namespace PseudoInst