gem5 v24.0.0.0
|
This class provides the wrapper interface for the system call implementations which are defined in the sim/syscall_emul files and bound to the ISAs in the architecture specific code (i.e. More...
#include <syscall_desc.hh>
Public Member Functions | |
void | doSyscall (ThreadContext *tc) |
Interface for invoking the system call funcion pointer. | |
std::string | name () const |
int | num () const |
virtual void | returnInto (ThreadContext *tc, const SyscallReturn &ret)=0 |
For use within the system call executor if new threads are created and need something returned into them. | |
Protected Types | |
using | Executor |
using | Dumper = std::function<std::string(std::string, ThreadContext *)> |
Protected Member Functions | |
SyscallDesc (int num, const char *name, Executor exec, Dumper dump) | |
void | retrySyscall (ThreadContext *tc) |
Private Member Functions | |
void | setupRetry (ThreadContext *tc) |
void | handleReturn (ThreadContext *tc, const SyscallReturn &ret) |
Private Attributes | |
std::string | _name |
System call name (e.g., open, mmap, clone, socket, etc.) | |
int | _num |
Executor | executor |
Mechanism for ISAs to connect to the emul function definitions. | |
Dumper | dumper |
This class provides the wrapper interface for the system call implementations which are defined in the sim/syscall_emul files and bound to the ISAs in the architecture specific code (i.e.
arch/X86/linux/process.cc).
Definition at line 69 of file syscall_desc.hh.
|
protected |
Definition at line 92 of file syscall_desc.hh.
|
protected |
Definition at line 90 of file syscall_desc.hh.
|
inlineprotected |
Definition at line 94 of file syscall_desc.hh.
void gem5::SyscallDesc::doSyscall | ( | ThreadContext * | tc | ) |
Interface for invoking the system call funcion pointer.
Note that this acts as a gateway for all system calls and serves a good point to add filters for behaviors or apply checks for all system calls.
tc | Handle for owning ThreadContext to pass information |
Definition at line 42 of file syscall_desc.cc.
References DPRINTF_SYSCALL, dumper, executor, handleReturn(), name(), gem5::SyscallReturn::needsRetry(), setupRetry(), and gem5::ThreadContext::suspend().
Referenced by gem5::ArmISA::EmuLinux::syscall(), and gem5::MipsISA::EmuLinux::syscall().
|
private |
Definition at line 94 of file syscall_desc.cc.
References DPRINTF_SYSCALL, gem5::SyscallReturn::encodedValue(), name(), returnInto(), and gem5::SyscallReturn::suppressed().
Referenced by doSyscall(), and retrySyscall().
|
inline |
Definition at line 80 of file syscall_desc.hh.
References _name.
Referenced by gem5::SyscallDescABI< ABI >::buildDumper(), doSyscall(), handleReturn(), gem5::ignoreFunc(), gem5::ignoreWarnOnceFunc(), gem5::openatFunc(), retrySyscall(), gem5::X86ISA::setThreadArea32Func(), setupRetry(), and gem5::unimplementedFunc().
|
inline |
Definition at line 81 of file syscall_desc.hh.
References _num.
Referenced by gem5::unimplementedFunc().
|
protected |
Definition at line 61 of file syscall_desc.cc.
References gem5::ThreadContext::activate(), DPRINTF_SYSCALL, dumper, executor, handleReturn(), name(), gem5::SyscallReturn::needsRetry(), and setupRetry().
Referenced by setupRetry().
|
pure virtual |
For use within the system call executor if new threads are created and need something returned into them.
Implemented in gem5::SyscallDescABI< ABI >.
Referenced by gem5::doClone(), and handleReturn().
|
private |
Definition at line 80 of file syscall_desc.cc.
References gem5::curEventQueue(), gem5::curTick(), gem5::MipsISA::event, gem5::ThreadContext::getCpuPtr(), name(), retrySyscall(), and gem5::EventQueue::schedule().
Referenced by doSyscall(), and retrySyscall().
|
private |
System call name (e.g., open, mmap, clone, socket, etc.)
Definition at line 102 of file syscall_desc.hh.
Referenced by name().
|
private |
Definition at line 103 of file syscall_desc.hh.
Referenced by num().
|
private |
Definition at line 110 of file syscall_desc.hh.
Referenced by doSyscall(), and retrySyscall().
|
private |
Mechanism for ISAs to connect to the emul function definitions.
Definition at line 109 of file syscall_desc.hh.
Referenced by doSyscall(), and retrySyscall().