gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::SyscallDesc Class Referenceabstract

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>

Inheritance diagram for gem5::SyscallDesc:
gem5::SyscallDescABI< ABI >

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
 

Detailed Description

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.

Member Typedef Documentation

◆ Dumper

using gem5::SyscallDesc::Dumper = std::function<std::string(std::string, ThreadContext *)>
protected

Definition at line 92 of file syscall_desc.hh.

◆ Executor

using gem5::SyscallDesc::Executor
protected
Initial value:
SyscallDesc(int num, const char *name, Executor exec, Dumper dump)
This class represents the return value from an emulated system call, including any errno setting.
ThreadContext is the external interface to all thread state for anything outside of the CPU.

Definition at line 90 of file syscall_desc.hh.

Constructor & Destructor Documentation

◆ SyscallDesc()

gem5::SyscallDesc::SyscallDesc ( int num,
const char * name,
Executor exec,
Dumper dump )
inlineprotected

Member Function Documentation

◆ doSyscall()

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.

Parameters
tcHandle 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().

◆ handleReturn()

void gem5::SyscallDesc::handleReturn ( ThreadContext * tc,
const SyscallReturn & ret )
private

◆ name()

◆ num()

◆ retrySyscall()

void gem5::SyscallDesc::retrySyscall ( ThreadContext * tc)
protected

◆ returnInto()

virtual void gem5::SyscallDesc::returnInto ( ThreadContext * tc,
const SyscallReturn & ret )
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().

◆ setupRetry()

void gem5::SyscallDesc::setupRetry ( ThreadContext * tc)
private

Member Data Documentation

◆ _name

std::string gem5::SyscallDesc::_name
private

System call name (e.g., open, mmap, clone, socket, etc.)

Definition at line 102 of file syscall_desc.hh.

Referenced by name(), and SyscallDesc().

◆ _num

int gem5::SyscallDesc::_num
private

Definition at line 103 of file syscall_desc.hh.

Referenced by num(), and SyscallDesc().

◆ dumper

Dumper gem5::SyscallDesc::dumper
private

Definition at line 110 of file syscall_desc.hh.

Referenced by doSyscall(), retrySyscall(), and SyscallDesc().

◆ executor

Executor gem5::SyscallDesc::executor
private

Mechanism for ISAs to connect to the emul function definitions.

Definition at line 109 of file syscall_desc.hh.

Referenced by doSyscall(), retrySyscall(), and SyscallDesc().


The documentation for this class was generated from the following files:

Generated on Mon May 26 2025 09:19:26 for gem5 by doxygen 1.13.2