}
void
- syscall(Fault *fault) override
+ syscall() override
{
panic("%s not implemented.", __FUNCTION__);
}
// 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();
}
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);
}
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;
::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
}
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);
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);
desc = syscallDescs64Low.get(num, false);
if (!desc)
desc = privSyscallDescs64.get(num);
- desc->doSyscall(tc, fault);
+ desc->doSyscall(tc);
}
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;
::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
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>(); }});
}
{}
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);
}
/// 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;
55: stfdu({{ Mem_df = Fs; }});
}
- 17: IntOp::sc({{ xc->syscall(&fault); }},
+ 17: IntOp::sc({{ xc->syscall(); }},
[ IsSyscall, IsNonSpeculative, IsSerializeAfter ]);
format FloatArithOp {
}
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);
}
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;
void
SyscallFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
{
- Fault *fault = NoFault;
- tc->syscall(fault);
+ tc->syscall();
}
} // namespace RiscvISA
{}
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,
{}
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);
}
/// 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;
/// 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;
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
{}
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);
}
}
{}
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
}
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);
setContext(tc);
break;
default:
- SparcProcess::handleTrap(trapNum, tc, fault);
+ SparcProcess::handleTrap(trapNum, tc);
}
}
/// 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.
/// 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,
}
void
-SparcProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
+SparcProcess::handleTrap(int trapNum, ThreadContext *tc)
{
PCState pc = tc->pcState();
switch (trapNum) {
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; }
{}
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);
}
/// 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;
// 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);
}
}
}
0x05: decode FullSystemInt {
- 0: SyscallInst::syscall('xc->syscall(&fault)',
+ 0: SyscallInst::syscall('xc->syscall()',
IsSyscall, IsNonSpeculative,
IsSerializeAfter);
default: decode MODE_MODE {
0x2: Inst::RDMSR();
0x3: rdpmc();
0x4: decode FullSystemInt {
- 0: SyscallInst::sysenter('xc->syscall(&fault)',
+ 0: SyscallInst::sysenter('xc->syscall()',
IsSyscall, IsNonSpeculative,
IsSerializeAfter);
default: sysenter();
};
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
};
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 &&
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
{
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;
{
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;
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()
}
/** 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(); }
/**
* Executes a syscall.
*/
- virtual void syscall(Fault *fault) = 0;
+ virtual void syscall() = 0;
/** @} */
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(); }
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);
++(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.
/** 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. */
void trap(const Fault &fault);
/** Emulates a syscall. */
- void syscall(Fault *fault) override;
+ void syscall() override;
public:
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);
/** 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. */
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__
/**
* 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(); }
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
// 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);
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; }
m5Syscall(ThreadContext *tc)
{
DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
- Fault fault;
- tc->syscall(&fault);
+ tc->syscall();
}
void
class ThreadContext;
void
-SyscallDesc::doSyscall(ThreadContext *tc, Fault *fault)
+SyscallDesc::doSyscall(ThreadContext *tc)
{
DPRINTF_SYSCALL(Base, "Calling %s...\n", dumper(name(), tc));
* 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; }