gem5 v24.0.0.0
Loading...
Searching...
No Matches
syscall_emul.hh File Reference

This file defines objects used to emulate syscalls from the target application on the host machine. More...

#include <sys/mount.h>
#include <fcntl.h>
#include <net/if.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <cerrno>
#include <memory>
#include <string>
#include "arch/generic/tlb.hh"
#include "base/intmath.hh"
#include "base/loader/object_file.hh"
#include "base/logging.hh"
#include "base/random.hh"
#include "base/trace.hh"
#include "base/types.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "kern/linux/linux.hh"
#include "mem/page_table.hh"
#include "mem/se_translating_port_proxy.hh"
#include "params/Process.hh"
#include "sim/emul_driver.hh"
#include "sim/futex_map.hh"
#include "sim/guest_abi.hh"
#include "sim/process.hh"
#include "sim/proxy_ptr.hh"
#include "sim/syscall_debug_macros.hh"
#include "sim/syscall_desc.hh"
#include "sim/syscall_emul_buf.hh"
#include "sim/syscall_return.hh"

Go to the source code of this file.

Namespaces

namespace  gem5
 Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
 

Macros

#define NO_STAT64   0
 

Typedefs

typedef struct statfs gem5::hst_statfs
 
typedef struct stat gem5::hst_stat
 
typedef struct stat64 gem5::hst_stat64
 

Functions

void gem5::warnUnsupportedOS (std::string syscall_name)
 
SyscallReturn gem5::unimplementedFunc (SyscallDesc *desc, ThreadContext *tc)
 Handler for unimplemented syscalls that we haven't thought about.
 
SyscallReturn gem5::ignoreFunc (SyscallDesc *desc, ThreadContext *tc)
 Handler for unimplemented syscalls that we never intend to implement (signal handling, etc.) and should not affect the correct behavior of the program.
 
SyscallReturn gem5::ignoreWarnOnceFunc (SyscallDesc *desc, ThreadContext *tc)
 Like above, but only prints a warning once per syscall desc it's used with.
 
SyscallReturn gem5::exitFunc (SyscallDesc *desc, ThreadContext *tc, int status)
 Target exit() handler: terminate current context.
 
SyscallReturn gem5::exitGroupFunc (SyscallDesc *desc, ThreadContext *tc, int status)
 Target exit_group() handler: terminate simulation. (exit all threads)
 
SyscallReturn gem5::setTidAddressFunc (SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
 Target set_tid_address() handler.
 
SyscallReturn gem5::getpagesizeFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getpagesize() handler.
 
SyscallReturn gem5::brkFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
 Target brk() handler: set brk address.
 
SyscallReturn gem5::closeFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
 Target close() handler.
 
SyscallReturn gem5::lseekFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
 Target lseek() handler.
 
SyscallReturn gem5::_llseekFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offset_high, uint32_t offset_low, VPtr<> result_ptr, int whence)
 Target _llseek() handler.
 
SyscallReturn gem5::shutdownFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int how)
 Target shutdown() handler.
 
SyscallReturn gem5::gethostnameFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, int name_len)
 Target gethostname() handler.
 
SyscallReturn gem5::getcwdFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, unsigned long size)
 Target getcwd() handler.
 
SyscallReturn gem5::unlinkFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
 Target unlink() handler.
 
SyscallReturn gem5::unlinkImpl (SyscallDesc *desc, ThreadContext *tc, std::string path)
 
SyscallReturn gem5::linkFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> new_pathname)
 Target link() handler.
 
SyscallReturn gem5::symlinkFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> new_pathname)
 Target symlink() handler.
 
SyscallReturn gem5::mkdirFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
 Target mkdir() handler.
 
SyscallReturn gem5::mkdirImpl (SyscallDesc *desc, ThreadContext *tc, std::string path, mode_t mode)
 
SyscallReturn gem5::mknodFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode, dev_t dev)
 Target mknod() handler.
 
SyscallReturn gem5::mknodImpl (SyscallDesc *desc, ThreadContext *tc, std::string path, mode_t mode, dev_t dev)
 
SyscallReturn gem5::chdirFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
 Target chdir() handler.
 
SyscallReturn gem5::rmdirFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
 
SyscallReturn gem5::rmdirImpl (SyscallDesc *desc, ThreadContext *tc, std::string path)
 
SyscallReturn gem5::renameFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> oldpath, VPtr<> newpath)
 Target rename() handler.
 
SyscallReturn gem5::renameImpl (SyscallDesc *desc, ThreadContext *tc, std::string old_name, std::string new_name)
 
SyscallReturn gem5::truncate64Func (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int64_t length)
 Target truncate64() handler.
 
SyscallReturn gem5::ftruncate64Func (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int64_t length)
 Target ftruncate64() handler.
 
SyscallReturn gem5::umaskFunc (SyscallDesc *desc, ThreadContext *tc)
 Target umask() handler.
 
SyscallReturn gem5::gettidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target gettid() handler.
 
SyscallReturn gem5::chownFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, uint32_t owner, uint32_t group)
 Target chown() handler.
 
SyscallReturn gem5::chownImpl (SyscallDesc *desc, ThreadContext *tc, std::string path, uint32_t owner, uint32_t group)
 
SyscallReturn gem5::getpgrpFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getpgrpFunc() handler.
 
SyscallReturn gem5::setpgidFunc (SyscallDesc *desc, ThreadContext *tc, int pid, int pgid)
 Target setpgid() handler.
 
SyscallReturn gem5::fchownFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
 Target fchown() handler.
 
SyscallReturn gem5::dupFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
 FIXME: The file description is not shared among file descriptors created with dup.
 
SyscallReturn gem5::dup2Func (SyscallDesc *desc, ThreadContext *tc, int old_tgt_fd, int new_tgt_fd)
 Target dup2() handler.
 
SyscallReturn gem5::fcntlFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, guest_abi::VarArgs< int > varargs)
 Target fcntl() handler.
 
SyscallReturn gem5::fcntl64Func (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd)
 Target fcntl64() handler.
 
SyscallReturn gem5::pipeFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
 Target pipe() handler.
 
SyscallReturn gem5::pipe2Func (SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr, int flags)
 Target pipe() handler.
 
SyscallReturn gem5::getpidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getpid() handler.
 
SyscallReturn gem5::getpeernameFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> sockAddrPtr, VPtr<> addrlenPtr)
 
SyscallReturn gem5::bindFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
 
SyscallReturn gem5::listenFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int backlog)
 
SyscallReturn gem5::connectFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
 
SyscallReturn gem5::recvmsgFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
 
SyscallReturn gem5::sendmsgFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
 
SyscallReturn gem5::getuidFunc (SyscallDesc *desc, ThreadContext *tc)
 
SyscallReturn gem5::getgidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getgid() handler.
 
SyscallReturn gem5::getppidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getppid() handler.
 
SyscallReturn gem5::geteuidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target geteuid() handler.
 
SyscallReturn gem5::getegidFunc (SyscallDesc *desc, ThreadContext *tc)
 Target getegid() handler.
 
SyscallReturn gem5::accessFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
 Target access() handler.
 
SyscallReturn gem5::accessImpl (SyscallDesc *desc, ThreadContext *tc, std::string path, mode_t mode)
 
SyscallReturn gem5::getsockoptFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, VPtr<> lenPtr)
 
SyscallReturn gem5::setsockoptFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, socklen_t len)
 
SyscallReturn gem5::getcpuFunc (SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
 
SyscallReturn gem5::getsocknameFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
 
template<class OS >
SyscallReturn gem5::atSyscallPath (ThreadContext *tc, int dirfd, std::string &path)
 
template<class OS >
SyscallReturn gem5::futexFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> uaddr, int op, int val, int timeout, VPtr<> uaddr2, int val3)
 Futex system call Implemented by Daniel Sanchez Used by printf's in multi-threaded apps.
 
SyscallReturn gem5::pipePseudoFunc (SyscallDesc *desc, ThreadContext *tc)
 Pseudo Funcs - These functions use a different return convension, returning a second value in a register other than the normal return register.
 
template<class T1 , class T2 >
void gem5::getElapsedTimeMicro (T1 &sec, T2 &usec)
 Helper function to convert current elapsed time to seconds and microseconds.
 
template<class T1 , class T2 >
void gem5::getElapsedTimeNano (T1 &sec, T2 &nsec)
 Helper function to convert current elapsed time to seconds and nanoseconds.
 
template<typename OS , typename TgtStatPtr , typename HostStatPtr >
void gem5::copyOutStatBuf (TgtStatPtr tgt, HostStatPtr host, bool fakeTTY=false)
 
template<typename OS , typename TgtStatPtr , typename HostStatPtr >
void gem5::copyOutStat64Buf (TgtStatPtr tgt, HostStatPtr host, bool fakeTTY=false)
 
template<class OS , typename TgtStatPtr , typename HostStatPtr >
void gem5::copyOutStatfsBuf (TgtStatPtr tgt, HostStatPtr host)
 
template<typename OS , typename TgtStatPtr , typename HostStatPtr >
void gem5::copyOutStatxBuf (TgtStatPtr tgt, HostStatPtr host, bool fakeTTY=false)
 
template<class OS >
SyscallReturn gem5::ioctlFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, unsigned req, VPtr<> addr)
 Target ioctl() handler.
 
template<class OS >
SyscallReturn gem5::openatFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_dirfd, VPtr<> pathname, int tgt_flags, int mode)
 Target open() handler.
 
template<class OS >
SyscallReturn gem5::openFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int tgt_flags, int mode)
 Target open() handler.
 
template<class OS >
SyscallReturn gem5::unlinkatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, int flags)
 Target unlinkat() handler.
 
template<class OS >
SyscallReturn gem5::faccessatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, int mode)
 Target facessat() handler.
 
template<class OS >
SyscallReturn gem5::readlinkatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr<> buf_ptr, typename OS::size_t bufsiz)
 Target readlinkat() handler.
 
template<class OS >
SyscallReturn gem5::readlinkFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> buf_ptr, typename OS::size_t bufsiz)
 Target readlink() handler.
 
template<class OS >
SyscallReturn gem5::renameatFunc (SyscallDesc *desc, ThreadContext *tc, int olddirfd, VPtr<> oldpath, int newdirfd, VPtr<> newpath)
 Target renameat() handler.
 
template<class OS >
SyscallReturn gem5::fchownatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, uint32_t owner, uint32_t group, int flags)
 Target fchownat() handler.
 
template<class OS >
SyscallReturn gem5::mkdiratFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode)
 Target mkdirat() handler.
 
template<class OS >
SyscallReturn gem5::mknodatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode, dev_t dev)
 Target mknodat() handler.
 
template<class OS >
SyscallReturn gem5::sysinfoFunc (SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tgt_sysinfo > sysinfo)
 Target sysinfo() handler.
 
template<class OS >
SyscallReturn gem5::fchmodatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode)
 Target chmod() handler.
 
template<class OS >
SyscallReturn gem5::chmodFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
 Target chmod() handler.
 
template<class OS >
SyscallReturn gem5::pollFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> fdsPtr, int nfds, int tmout)
 
template<class OS >
SyscallReturn gem5::fchmodFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t mode)
 Target fchmod() handler.
 
template<class OS >
SyscallReturn gem5::mremapFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> start, uint64_t old_length, uint64_t new_length, uint64_t flags, guest_abi::VarArgs< uint64_t > varargs)
 Target mremap() handler.
 
template<class OS >
SyscallReturn gem5::statFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat > tgt_stat)
 Target stat() handler.
 
template<class OS >
SyscallReturn gem5::newfstatatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat, int flags)
 Target newfstatat() handler.
 
template<class OS >
SyscallReturn gem5::fstatat64Func (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
 Target fstatat64() handler.
 
template<class OS >
SyscallReturn gem5::stat64Func (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
 Target stat64() handler.
 
template<class OS >
SyscallReturn gem5::statxFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, int flags, unsigned int mask, VPtr< typename OS::tgt_statx > tgt_statx)
 Target statx() handler.
 
template<class OS >
SyscallReturn gem5::fstat64Func (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat64 > tgt_stat)
 Target fstat64() handler.
 
template<class OS >
SyscallReturn gem5::lstatFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat > tgt_stat)
 Target lstat() handler.
 
template<class OS >
SyscallReturn gem5::lstat64Func (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
 Target lstat64() handler.
 
template<class OS >
SyscallReturn gem5::fstatFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat > tgt_stat)
 Target fstat() handler.
 
template<class OS >
SyscallReturn gem5::statfsFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_statfs > tgt_stat)
 Target statfs() handler.
 
template<class OS >
SyscallReturn gem5::doClone (SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, VPtr<> ptidPtr, VPtr<> ctidPtr, VPtr<> tlsPtr)
 
template<class OS >
SyscallReturn gem5::clone3Func (SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tgt_clone_args > cl_args, RegVal size)
 
template<class OS >
SyscallReturn gem5::cloneFunc (SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, VPtr<> ptidPtr, VPtr<> ctidPtr, VPtr<> tlsPtr)
 
template<class OS >
SyscallReturn gem5::cloneBackwardsFunc (SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, VPtr<> ptidPtr, VPtr<> tlsPtr, VPtr<> ctidPtr)
 
template<class OS >
SyscallReturn gem5::fstatfsFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_statfs > tgt_stat)
 Target fstatfs() handler.
 
template<class OS >
SyscallReturn gem5::readvFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t tiov_base, typename OS::size_t count)
 Target readv() handler.
 
template<class OS >
SyscallReturn gem5::writevFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t tiov_base, typename OS::size_t count)
 Target writev() handler.
 
template<class OS >
SyscallReturn gem5::mmapFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> start, typename OS::size_t length, int prot, int tgt_flags, int tgt_fd, typename OS::off_t offset)
 Target mmap() handler.
 
template<class OS >
SyscallReturn gem5::pread64Func (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
 
template<class OS >
SyscallReturn gem5::pwrite64Func (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
 
template<class OS >
SyscallReturn gem5::mmap2Func (SyscallDesc *desc, ThreadContext *tc, VPtr<> start, typename OS::size_t length, int prot, int tgt_flags, int tgt_fd, typename OS::off_t offset)
 Target mmap2() handler.
 
template<class OS >
SyscallReturn gem5::getrlimitFunc (SyscallDesc *desc, ThreadContext *tc, unsigned resource, VPtr< typename OS::rlimit > rlp)
 Target getrlimit() handler.
 
template<class OS >
SyscallReturn gem5::prlimitFunc (SyscallDesc *desc, ThreadContext *tc, int pid, int resource, VPtr<> n, VPtr< typename OS::rlimit > rlp)
 
template<class OS >
SyscallReturn gem5::clock_gettimeFunc (SyscallDesc *desc, ThreadContext *tc, int clk_id, VPtr< typename OS::timespec > tp)
 Target clock_gettime() function.
 
template<class OS >
SyscallReturn gem5::clock_getresFunc (SyscallDesc *desc, ThreadContext *tc, int clk_id, VPtr< typename OS::timespec > tp)
 Target clock_getres() function.
 
template<class OS >
SyscallReturn gem5::gettimeofdayFunc (SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::timeval > tp, VPtr<> tz_ptr)
 Target gettimeofday() handler.
 
template<class OS >
SyscallReturn gem5::futimesatFunc (SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::timeval[2]> tp)
 Target futimesat() handler.
 
template<class OS >
SyscallReturn gem5::utimesFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::timeval[2]> tp)
 Target utimes() handler.
 
template<class OS >
SyscallReturn gem5::execveFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> argv_mem_loc, VPtr<> envp_mem_loc)
 
template<class OS >
SyscallReturn gem5::getrusageFunc (SyscallDesc *desc, ThreadContext *tc, int who, VPtr< typename OS::rusage > rup)
 Target getrusage() function.
 
template<class OS >
SyscallReturn gem5::timesFunc (SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tms > bufp)
 Target times() function.
 
template<class OS >
SyscallReturn gem5::timeFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> taddr)
 Target time() function.
 
template<class OS >
SyscallReturn gem5::tgkillFunc (SyscallDesc *desc, ThreadContext *tc, int tgid, int tid, int sig)
 
template<class OS >
SyscallReturn gem5::socketFunc (SyscallDesc *desc, ThreadContext *tc, int domain, int type, int prot)
 
template<class OS >
SyscallReturn gem5::socketpairFunc (SyscallDesc *desc, ThreadContext *tc, int domain, int type, int prot, VPtr<> svPtr)
 
template<class OS >
SyscallReturn gem5::selectFunc (SyscallDesc *desc, ThreadContext *tc, int nfds, VPtr< typename OS::fd_set > readfds, VPtr< typename OS::fd_set > writefds, VPtr< typename OS::fd_set > errorfds, VPtr< typename OS::timeval > timeout)
 
template<class OS >
SyscallReturn gem5::readFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int nbytes)
 
template<class OS >
SyscallReturn gem5::writeFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int nbytes)
 
template<class OS >
SyscallReturn gem5::wait4Func (SyscallDesc *desc, ThreadContext *tc, pid_t pid, VPtr<> statPtr, int options, VPtr<> rusagePtr)
 
template<class OS >
SyscallReturn gem5::acceptFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
 
template<class OS >
SyscallReturn gem5::eventfdFunc (SyscallDesc *desc, ThreadContext *tc, unsigned initval, int in_flags)
 Target eventfd() function.
 
template<class OS >
SyscallReturn gem5::schedGetaffinityFunc (SyscallDesc *desc, ThreadContext *tc, pid_t pid, typename OS::size_t cpusetsize, VPtr<> cpu_set_mask)
 Target sched_getaffinity.
 
template<class OS >
SyscallReturn gem5::recvfromFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, typename OS::size_t buf_len, int flags, VPtr<> addr_ptr, VPtr<> addrlen_ptr)
 
template<typename OS >
SyscallReturn gem5::sendtoFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, typename OS::size_t buf_len, int flags, VPtr<> addr_ptr, socklen_t addr_len)
 
template<typename OS >
SyscallReturn gem5::munmapFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> start, typename OS::size_t length)
 Target munmap() handler.
 
template<typename OS >
SyscallReturn gem5::fallocateFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int mode, typename OS::off_t offset, typename OS::off_t len)
 
template<typename OS >
SyscallReturn gem5::truncateFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, typename OS::off_t length)
 Target truncate() handler.
 
template<typename OS >
SyscallReturn gem5::ftruncateFunc (SyscallDesc *desc, ThreadContext *tc, int tgt_fd, typename OS::off_t length)
 Target ftruncate() handler.
 
template<typename OS >
SyscallReturn gem5::getrandomFunc (SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, typename OS::size_t count, unsigned int flags)
 

Variables

const unsigned gem5::seconds_since_epoch = 1000 * 1000 * 1000
 Approximate seconds since the epoch (1/1/1970).
 

Detailed Description

This file defines objects used to emulate syscalls from the target application on the host machine.

Definition in file syscall_emul.hh.

Macro Definition Documentation

◆ NO_STAT64

#define NO_STAT64   0

Definition at line 50 of file syscall_emul.hh.


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0