misc: Remove the "fault" parameter from syscall functions.
This parameter was never set or used, just plumbed everywhere, occasionally with a dummy value. This change removes all of that plumbing. Change-Id: I9bc31ffd1fbc4952c5d3096f7f21eab30102300b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33277 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
@@ -445,7 +445,7 @@ class ThreadContext : public ::ThreadContext
|
||||
}
|
||||
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
syscall() override
|
||||
{
|
||||
panic("%s not implemented.", __FUNCTION__);
|
||||
}
|
||||
|
||||
@@ -865,8 +865,7 @@ SupervisorCall::invoke(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
|
||||
// As of now, there isn't a 32 bit thumb version of this instruction.
|
||||
assert(!machInst.bigThumb);
|
||||
Fault fault;
|
||||
tc->syscall(&fault);
|
||||
tc->syscall();
|
||||
|
||||
// Advance the PC since that won't happen automatically.
|
||||
PCState pc = tc->pcState();
|
||||
|
||||
@@ -175,15 +175,15 @@ ArmFreebsdProcess64::initState()
|
||||
}
|
||||
|
||||
void
|
||||
ArmFreebsdProcess32::syscall(ThreadContext *tc, Fault *fault)
|
||||
ArmFreebsdProcess32::syscall(ThreadContext *tc)
|
||||
{
|
||||
ArmProcess32::syscall(tc, fault);
|
||||
syscallDescs32.get(tc->readIntReg(INTREG_R7))->doSyscall(tc, fault);
|
||||
ArmProcess32::syscall(tc);
|
||||
syscallDescs32.get(tc->readIntReg(INTREG_R7))->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
ArmFreebsdProcess64::syscall(ThreadContext *tc, Fault *fault)
|
||||
ArmFreebsdProcess64::syscall(ThreadContext *tc)
|
||||
{
|
||||
ArmProcess64::syscall(tc, fault);
|
||||
syscallDescs64.get(tc->readIntReg(INTREG_X8))->doSyscall(tc, fault);
|
||||
ArmProcess64::syscall(tc);
|
||||
syscallDescs64.get(tc->readIntReg(INTREG_X8))->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
|
||||
|
||||
void initState() override;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// A page to hold "kernel" provided functions. The name might be wrong.
|
||||
static const Addr commPage;
|
||||
@@ -100,7 +100,7 @@ class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits
|
||||
::Loader::Arch _arch);
|
||||
|
||||
void initState() override;
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
struct SyscallABI : public ArmProcess64::SyscallABI,
|
||||
public ArmFreebsdProcessBits::SyscallABI
|
||||
|
||||
@@ -912,9 +912,9 @@ ArmLinuxProcess64::initState()
|
||||
}
|
||||
|
||||
void
|
||||
ArmLinuxProcess32::syscall(ThreadContext *tc, Fault *fault)
|
||||
ArmLinuxProcess32::syscall(ThreadContext *tc)
|
||||
{
|
||||
ArmProcess32::syscall(tc, fault);
|
||||
ArmProcess32::syscall(tc);
|
||||
|
||||
int num = tc->readIntReg(INTREG_R7);
|
||||
SyscallDesc *desc = syscallDescs32Low.get(num, false);
|
||||
@@ -922,13 +922,13 @@ ArmLinuxProcess32::syscall(ThreadContext *tc, Fault *fault)
|
||||
desc = syscallDescs32Low.get(num, false);
|
||||
if (!desc)
|
||||
desc = privSyscallDescs32.get(num);
|
||||
desc->doSyscall(tc, fault);
|
||||
desc->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
ArmLinuxProcess64::syscall(ThreadContext *tc, Fault *fault)
|
||||
ArmLinuxProcess64::syscall(ThreadContext *tc)
|
||||
{
|
||||
ArmProcess64::syscall(tc, fault);
|
||||
ArmProcess64::syscall(tc);
|
||||
|
||||
int num = tc->readIntReg(INTREG_X8);
|
||||
SyscallDesc *desc = syscallDescs64Low.get(num, false);
|
||||
@@ -936,5 +936,5 @@ ArmLinuxProcess64::syscall(ThreadContext *tc, Fault *fault)
|
||||
desc = syscallDescs64Low.get(num, false);
|
||||
if (!desc)
|
||||
desc = privSyscallDescs64.get(num);
|
||||
desc->doSyscall(tc, fault);
|
||||
desc->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
|
||||
|
||||
void initState() override;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// A page to hold "kernel" provided functions. The name might be wrong.
|
||||
static const Addr commPage;
|
||||
@@ -100,7 +100,7 @@ class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits
|
||||
::Loader::Arch _arch);
|
||||
|
||||
void initState() override;
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
struct SyscallABI : public ArmProcess64::SyscallABI,
|
||||
public ArmLinuxProcessBits::SyscallABI
|
||||
|
||||
@@ -159,7 +159,7 @@ decode OPCODE_HI default Unknown::unknown() {
|
||||
0x2: movz({{ Rd = (Rt == 0) ? Rs : Rd; }});
|
||||
0x3: movn({{ Rd = (Rt != 0) ? Rs : Rd; }});
|
||||
0x4: decode FullSystemInt {
|
||||
0: syscall_se({{ xc->syscall(&fault); }},
|
||||
0: syscall_se({{ xc->syscall(); }},
|
||||
IsSerializeAfter, IsNonSpeculative);
|
||||
default: syscall({{ fault = std::make_shared<SystemCallFault>(); }});
|
||||
}
|
||||
|
||||
@@ -476,8 +476,8 @@ MipsLinuxProcess::MipsLinuxProcess(ProcessParams * params,
|
||||
{}
|
||||
|
||||
void
|
||||
MipsLinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
MipsLinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
MipsProcess::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(2))->doSyscall(tc, fault);
|
||||
MipsProcess::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(2))->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class MipsLinuxProcess : public MipsProcess
|
||||
/// ID of the thread group leader for the process
|
||||
uint64_t __tgid;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// Syscall descriptors, indexed by call number.
|
||||
static SyscallDescTable<SyscallABI> syscallDescs;
|
||||
|
||||
@@ -515,7 +515,7 @@ decode OPCODE default Unknown::unknown() {
|
||||
55: stfdu({{ Mem_df = Fs; }});
|
||||
}
|
||||
|
||||
17: IntOp::sc({{ xc->syscall(&fault); }},
|
||||
17: IntOp::sc({{ xc->syscall(); }},
|
||||
[ IsSyscall, IsNonSpeculative, IsSerializeAfter ]);
|
||||
|
||||
format FloatArithOp {
|
||||
|
||||
@@ -451,8 +451,8 @@ PowerLinuxProcess::initState()
|
||||
}
|
||||
|
||||
void
|
||||
PowerLinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
PowerLinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
PowerProcess::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(0))->doSyscall(tc, fault);
|
||||
PowerProcess::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(0))->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class PowerLinuxProcess : public PowerProcess
|
||||
|
||||
void initState() override;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// Syscall descriptors, indexed by call number.
|
||||
static SyscallDescTable<SyscallABI> syscallDescs;
|
||||
|
||||
@@ -194,8 +194,7 @@ BreakpointFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
void
|
||||
SyscallFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
{
|
||||
Fault *fault = NoFault;
|
||||
tc->syscall(fault);
|
||||
tc->syscall();
|
||||
}
|
||||
|
||||
} // namespace RiscvISA
|
||||
|
||||
@@ -781,10 +781,10 @@ RiscvLinuxProcess64::RiscvLinuxProcess64(ProcessParams * params,
|
||||
{}
|
||||
|
||||
void
|
||||
RiscvLinuxProcess64::syscall(ThreadContext *tc, Fault *fault)
|
||||
RiscvLinuxProcess64::syscall(ThreadContext *tc)
|
||||
{
|
||||
RiscvProcess64::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(SyscallNumReg))->doSyscall(tc, fault);
|
||||
RiscvProcess64::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(SyscallNumReg))->doSyscall(tc);
|
||||
}
|
||||
|
||||
RiscvLinuxProcess32::RiscvLinuxProcess32(ProcessParams * params,
|
||||
@@ -792,8 +792,8 @@ RiscvLinuxProcess32::RiscvLinuxProcess32(ProcessParams * params,
|
||||
{}
|
||||
|
||||
void
|
||||
RiscvLinuxProcess32::syscall(ThreadContext *tc, Fault *fault)
|
||||
RiscvLinuxProcess32::syscall(ThreadContext *tc)
|
||||
{
|
||||
RiscvProcess32::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(SyscallNumReg))->doSyscall(tc, fault);
|
||||
RiscvProcess32::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(SyscallNumReg))->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class RiscvLinuxProcess64 : public RiscvProcess64
|
||||
/// ID of the thread group leader for the process
|
||||
uint64_t __tgid;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// Syscall descriptors, indexed by call number.
|
||||
static SyscallDescTable<SyscallABI> syscallDescs;
|
||||
@@ -68,7 +68,7 @@ class RiscvLinuxProcess32 : public RiscvProcess32
|
||||
/// ID of the thread group leader for the process
|
||||
uint64_t __tgid;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// Array of syscall descriptors, indexed by call number.
|
||||
static SyscallDescTable<SyscallABI> syscallDescs;
|
||||
|
||||
@@ -815,8 +815,7 @@ TrapInstruction::invoke(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
SparcProcess *sp = dynamic_cast<SparcProcess *>(p);
|
||||
assert(sp);
|
||||
|
||||
Fault fault;
|
||||
sp->handleTrap(_n, tc, &fault);
|
||||
sp->handleTrap(_n, tc);
|
||||
|
||||
// We need to explicitly advance the pc, since that's not done for us
|
||||
// on a faulting instruction
|
||||
|
||||
@@ -81,21 +81,21 @@ Sparc32LinuxProcess::Sparc32LinuxProcess(ProcessParams * params,
|
||||
{}
|
||||
|
||||
void
|
||||
Sparc32LinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
Sparc32LinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
Sparc32Process::syscall(tc, fault);
|
||||
syscall32Descs.get(tc->readIntReg(1))->doSyscall(tc, fault);
|
||||
Sparc32Process::syscall(tc);
|
||||
syscall32Descs.get(tc->readIntReg(1))->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
|
||||
Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc)
|
||||
{
|
||||
switch (trapNum) {
|
||||
case 0x10: //Linux 32 bit syscall trap
|
||||
tc->syscall(fault);
|
||||
tc->syscall();
|
||||
break;
|
||||
default:
|
||||
SparcProcess::handleTrap(trapNum, tc, fault);
|
||||
SparcProcess::handleTrap(trapNum, tc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,10 +105,10 @@ Sparc64LinuxProcess::Sparc64LinuxProcess(ProcessParams * params,
|
||||
{}
|
||||
|
||||
void
|
||||
Sparc64LinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
Sparc64LinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
Sparc64Process::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(1))->doSyscall(tc, fault);
|
||||
Sparc64Process::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(1))->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -124,12 +124,12 @@ Sparc64LinuxProcess::setContext(ThreadContext *tc)
|
||||
}
|
||||
|
||||
void
|
||||
Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
|
||||
Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc)
|
||||
{
|
||||
switch (trapNum) {
|
||||
// case 0x10: // Linux 32 bit syscall trap
|
||||
case 0x6d: // Linux 64 bit syscall trap
|
||||
tc->syscall(fault);
|
||||
tc->syscall();
|
||||
break;
|
||||
case 0x6e: // Linux 64 bit getcontext trap
|
||||
getContext(tc);
|
||||
@@ -138,6 +138,6 @@ Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
|
||||
setContext(tc);
|
||||
break;
|
||||
default:
|
||||
SparcProcess::handleTrap(trapNum, tc, fault);
|
||||
SparcProcess::handleTrap(trapNum, tc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32Process
|
||||
/// Constructor.
|
||||
Sparc32LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
void handleTrap(int trapNum, ThreadContext *tc, Fault *fault) override;
|
||||
void handleTrap(int trapNum, ThreadContext *tc) override;
|
||||
};
|
||||
|
||||
/// A process with emulated 32 bit SPARC/Linux syscalls.
|
||||
@@ -68,12 +68,12 @@ class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64Process
|
||||
/// Constructor.
|
||||
Sparc64LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
void getContext(ThreadContext *tc);
|
||||
void setContext(ThreadContext *tc);
|
||||
|
||||
void handleTrap(int trapNum, ThreadContext *tc, Fault *fault) override;
|
||||
void handleTrap(int trapNum, ThreadContext *tc) override;
|
||||
};
|
||||
|
||||
SyscallReturn getresuidFunc(SyscallDesc *desc, ThreadContext *tc,
|
||||
|
||||
@@ -66,7 +66,7 @@ SparcProcess::SparcProcess(ProcessParams *params,
|
||||
}
|
||||
|
||||
void
|
||||
SparcProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
|
||||
SparcProcess::handleTrap(int trapNum, ThreadContext *tc)
|
||||
{
|
||||
PCState pc = tc->pcState();
|
||||
switch (trapNum) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class SparcProcess : public Process
|
||||
public:
|
||||
|
||||
// Handles traps which request services from the operating system
|
||||
virtual void handleTrap(int trapNum, ThreadContext *tc, Fault *fault);
|
||||
virtual void handleTrap(int trapNum, ThreadContext *tc);
|
||||
|
||||
Addr readFillStart() { return fillStart; }
|
||||
Addr readSpillStart() { return spillStart; }
|
||||
|
||||
@@ -350,8 +350,8 @@ SparcSolarisProcess::SparcSolarisProcess(ProcessParams *params,
|
||||
{}
|
||||
|
||||
void
|
||||
SparcSolarisProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
SparcSolarisProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
Sparc64Process::syscall(tc, fault);
|
||||
syscallDescs.get(tc->readIntReg(1))->doSyscall(tc, fault);
|
||||
Sparc64Process::syscall(tc);
|
||||
syscallDescs.get(tc->readIntReg(1))->doSyscall(tc);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class SparcSolarisProcess : public Sparc64Process
|
||||
/// The target system's hostname.
|
||||
static const char *hostname;
|
||||
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
|
||||
/// Array of syscall descriptors, indexed by call number.
|
||||
static SyscallDescTable<Sparc64Process::SyscallABI> syscallDescs;
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
// will sign extend it, and there's no easy way to
|
||||
// specify only checking the first byte.
|
||||
0xffffffffffffff80:
|
||||
SyscallInst::int80('xc->syscall(&fault)',
|
||||
SyscallInst::int80('xc->syscall()',
|
||||
IsSyscall, IsNonSpeculative,
|
||||
IsSerializeAfter);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
}
|
||||
}
|
||||
0x05: decode FullSystemInt {
|
||||
0: SyscallInst::syscall('xc->syscall(&fault)',
|
||||
0: SyscallInst::syscall('xc->syscall()',
|
||||
IsSyscall, IsNonSpeculative,
|
||||
IsSerializeAfter);
|
||||
default: decode MODE_MODE {
|
||||
@@ -431,7 +431,7 @@
|
||||
0x2: Inst::RDMSR();
|
||||
0x3: rdpmc();
|
||||
0x4: decode FullSystemInt {
|
||||
0: SyscallInst::sysenter('xc->syscall(&fault)',
|
||||
0: SyscallInst::sysenter('xc->syscall()',
|
||||
IsSyscall, IsNonSpeculative,
|
||||
IsSerializeAfter);
|
||||
default: sysenter();
|
||||
|
||||
@@ -566,10 +566,10 @@ static SyscallDescTable<X86_64LinuxProcess::SyscallABI> syscallDescs64 = {
|
||||
};
|
||||
|
||||
void
|
||||
X86_64LinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
X86_64LinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
X86_64Process::syscall(tc, fault);
|
||||
syscallDescs64.get(tc->readIntReg(INTREG_RAX))->doSyscall(tc, fault);
|
||||
X86_64Process::syscall(tc);
|
||||
syscallDescs64.get(tc->readIntReg(INTREG_RAX))->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -915,9 +915,9 @@ static SyscallDescTable<I386LinuxProcess::SyscallABI> syscallDescs32 = {
|
||||
};
|
||||
|
||||
void
|
||||
I386LinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
I386LinuxProcess::syscall(ThreadContext *tc)
|
||||
{
|
||||
I386Process::syscall(tc, fault);
|
||||
I386Process::syscall(tc);
|
||||
PCState pc = tc->pcState();
|
||||
Addr eip = pc.pc();
|
||||
if (eip >= vsyscallPage.base &&
|
||||
@@ -925,7 +925,7 @@ I386LinuxProcess::syscall(ThreadContext *tc, Fault *fault)
|
||||
pc.npc(vsyscallPage.base + vsyscallPage.vsysexitOffset);
|
||||
tc->pcState(pc);
|
||||
}
|
||||
syscallDescs32.get(tc->readIntReg(INTREG_RAX))->doSyscall(tc, fault);
|
||||
syscallDescs32.get(tc->readIntReg(INTREG_RAX))->doSyscall(tc);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -53,7 +53,7 @@ class X86_64LinuxProcess : public X86_64Process
|
||||
{
|
||||
public:
|
||||
using X86_64Process::X86_64Process;
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process,
|
||||
RegVal flags) override;
|
||||
|
||||
@@ -67,7 +67,7 @@ class I386LinuxProcess : public I386Process
|
||||
{
|
||||
public:
|
||||
using I386Process::I386Process;
|
||||
void syscall(ThreadContext *tc, Fault *fault) override;
|
||||
void syscall(ThreadContext *tc) override;
|
||||
void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process,
|
||||
RegVal flags) override;
|
||||
|
||||
|
||||
@@ -577,7 +577,7 @@ class CheckerCPU : public BaseCPU, public ExecContext
|
||||
void wakeup(ThreadID tid) override { }
|
||||
// Assume that the normal CPU's call to syscall was successful.
|
||||
// The checker's state would have already been updated by the syscall.
|
||||
void syscall(Fault *fault) override { }
|
||||
void syscall() override { }
|
||||
|
||||
void
|
||||
handleError()
|
||||
|
||||
@@ -172,11 +172,7 @@ class CheckerThreadContext : public ThreadContext
|
||||
}
|
||||
|
||||
/** Executes a syscall in SE mode. */
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
{
|
||||
return actualTC->syscall(fault);
|
||||
}
|
||||
void syscall() override { return actualTC->syscall(); }
|
||||
|
||||
Status status() const override { return actualTC->status(); }
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ class ExecContext {
|
||||
/**
|
||||
* Executes a syscall.
|
||||
*/
|
||||
virtual void syscall(Fault *fault) = 0;
|
||||
virtual void syscall() = 0;
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -379,11 +379,7 @@ class ExecContext : public ::ExecContext
|
||||
return thread.setMiscReg(reg.index(), val);
|
||||
}
|
||||
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
{
|
||||
thread.syscall(fault);
|
||||
}
|
||||
void syscall() override { thread.syscall(); }
|
||||
|
||||
ThreadContext *tcBase() const override { return thread.getTC(); }
|
||||
|
||||
|
||||
@@ -915,7 +915,7 @@ FullO3CPU<Impl>::trap(const Fault &fault, ThreadID tid,
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::syscall(ThreadID tid, Fault *fault)
|
||||
FullO3CPU<Impl>::syscall(ThreadID tid)
|
||||
{
|
||||
DPRINTF(O3CPU, "[tid:%i] Executing syscall().\n\n", tid);
|
||||
|
||||
@@ -926,7 +926,7 @@ FullO3CPU<Impl>::syscall(ThreadID tid, Fault *fault)
|
||||
++(this->thread[tid]->funcExeInst);
|
||||
|
||||
// Execute the actual syscall.
|
||||
this->thread[tid]->syscall(fault);
|
||||
this->thread[tid]->syscall();
|
||||
|
||||
// Decrease funcExeInst by one as the normal commit will handle
|
||||
// incrementing it.
|
||||
|
||||
@@ -280,7 +280,7 @@ class FullO3CPU : public BaseO3CPU
|
||||
/** Executes a syscall.
|
||||
* @todo: Determine if this needs to be virtual.
|
||||
*/
|
||||
void syscall(ThreadID tid, Fault *fault);
|
||||
void syscall(ThreadID tid);
|
||||
|
||||
/** Starts draining the CPU's pipeline of all instructions in
|
||||
* order to stop all memory accesses. */
|
||||
|
||||
@@ -249,7 +249,7 @@ class BaseO3DynInst : public BaseDynInst<Impl>
|
||||
void trap(const Fault &fault);
|
||||
|
||||
/** Emulates a syscall. */
|
||||
void syscall(Fault *fault) override;
|
||||
void syscall() override;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -189,13 +189,13 @@ BaseO3DynInst<Impl>::trap(const Fault &fault)
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
BaseO3DynInst<Impl>::syscall(Fault *fault)
|
||||
BaseO3DynInst<Impl>::syscall()
|
||||
{
|
||||
// HACK: check CPU's nextPC before and after syscall. If it
|
||||
// changes, update this instruction's nextPC because the syscall
|
||||
// must have changed the nextPC.
|
||||
TheISA::PCState curPC = this->cpu->pcState(this->threadNumber);
|
||||
this->cpu->syscall(this->threadNumber, fault);
|
||||
this->cpu->syscall(this->threadNumber);
|
||||
TheISA::PCState newPC = this->cpu->pcState(this->threadNumber);
|
||||
if (!(curPC == newPC)) {
|
||||
this->pcState(newPC);
|
||||
|
||||
@@ -421,9 +421,9 @@ class O3ThreadContext : public ThreadContext
|
||||
|
||||
/** Executes a syscall in SE mode. */
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
syscall() override
|
||||
{
|
||||
return cpu->syscall(thread->threadId(), fault);
|
||||
return cpu->syscall(thread->threadId());
|
||||
}
|
||||
|
||||
/** Reads the funcExeInst counter. */
|
||||
|
||||
@@ -127,10 +127,7 @@ struct O3ThreadState : public ThreadState {
|
||||
ThreadContext *getTC() { return tc; }
|
||||
|
||||
/** Handles the syscall. */
|
||||
void syscall(Fault *fault)
|
||||
{
|
||||
process->syscall(tc, fault);
|
||||
}
|
||||
void syscall() { process->syscall(tc); }
|
||||
};
|
||||
|
||||
#endif // __CPU_O3_THREAD_STATE_HH__
|
||||
|
||||
@@ -494,11 +494,7 @@ class SimpleExecContext : public ExecContext {
|
||||
/**
|
||||
* Executes a syscall specified by the callnum.
|
||||
*/
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
{
|
||||
thread->syscall(fault);
|
||||
}
|
||||
void syscall() override { thread->syscall(); }
|
||||
|
||||
/** Returns a pointer to the ThreadContext. */
|
||||
ThreadContext *tcBase() const override { return thread->getTC(); }
|
||||
|
||||
@@ -576,11 +576,7 @@ class SimpleThread : public ThreadState, public ThreadContext
|
||||
return ThreadState::readFuncExeInst();
|
||||
}
|
||||
|
||||
void
|
||||
syscall(Fault *fault) override
|
||||
{
|
||||
process->syscall(this, fault);
|
||||
}
|
||||
void syscall() override { process->syscall(this); }
|
||||
|
||||
RegVal readIntRegFlat(RegIndex idx) const override { return intRegs[idx]; }
|
||||
void
|
||||
|
||||
@@ -293,7 +293,7 @@ class ThreadContext : public PCEventScope
|
||||
// Same with st cond failures.
|
||||
virtual Counter readFuncExeInst() const = 0;
|
||||
|
||||
virtual void syscall(Fault *fault) = 0;
|
||||
virtual void syscall() = 0;
|
||||
|
||||
// This function exits the thread context in the CPU and returns
|
||||
// 1 if the CPU has no more active threads (meaning it's OK to exit);
|
||||
|
||||
@@ -75,7 +75,7 @@ class Process : public SimObject
|
||||
void initState() override;
|
||||
DrainState drain() override;
|
||||
|
||||
virtual void syscall(ThreadContext *tc, Fault *fault) { numSyscalls++; }
|
||||
virtual void syscall(ThreadContext *tc) { numSyscalls++; }
|
||||
|
||||
inline uint64_t uid() { return _uid; }
|
||||
inline uint64_t euid() { return _euid; }
|
||||
|
||||
@@ -479,8 +479,7 @@ void
|
||||
m5Syscall(ThreadContext *tc)
|
||||
{
|
||||
DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
|
||||
Fault fault;
|
||||
tc->syscall(&fault);
|
||||
tc->syscall();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
class ThreadContext;
|
||||
|
||||
void
|
||||
SyscallDesc::doSyscall(ThreadContext *tc, Fault *fault)
|
||||
SyscallDesc::doSyscall(ThreadContext *tc)
|
||||
{
|
||||
DPRINTF_SYSCALL(Base, "Calling %s...\n", dumper(name(), tc));
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class SyscallDesc {
|
||||
* to add filters for behaviors or apply checks for all system calls.
|
||||
* @param tc Handle for owning ThreadContext to pass information
|
||||
*/
|
||||
void doSyscall(ThreadContext *tc, Fault *fault);
|
||||
void doSyscall(ThreadContext *tc);
|
||||
|
||||
std::string name() const { return _name; }
|
||||
int num() const { return _num; }
|
||||
|
||||
Reference in New Issue
Block a user