34 #ifndef __PROCESS_HH__ 35 #define __PROCESS_HH__ 43 #include "arch/registers.hh" 47 #include "config/the_isa.hh" 158 bool map(
Addr vaddr,
Addr paddr,
int size,
bool cacheable =
true);
280 std::shared_ptr<FDArray>
fds;
295 #endif // __PROCESS_HH__ virtual SyscallDesc * getDesc(int callnum)=0
void revokeThreadContext(int context_id)
After delegating a thread context to a child process no longer should relate to the ThreadContext...
uint64_t childClearTID
Calls a futex wakeup at the address specified by this pointer when this process exits.
DrainState
Object drain/handover states.
static std::stack< std::string > path
std::vector< ContextID > contextIds
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
SETranslatingPortProxy initVirtMem
void regStats() override
Callback to set stat parameters.
Stats::Scalar numSyscalls
void doSyscall(int64_t callnum, ThreadContext *tc, Fault *fault)
ObjectFile * getInterpreter()
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
static Process * tryLoaders(ProcessParams *params, ObjectFile *obj_file)
std::shared_ptr< MemState > memState
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
DrainState drain() override
Notify an object that it needs to drain its state.
void replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc, ThreadContext *new_tc, bool alloc_page)
std::string absolutePath(const std::string &path, bool host_fs)
Return an absolute path given a relative path paired with the current working directory of the proces...
void assignThreadContext(ContextID context_id)
bool map(Addr vaddr, Addr paddr, int size, bool cacheable=true)
Maps a contiguous range of virtual addresses in this process's address space to a contiguous range of...
const Params * params() const
virtual RegVal getSyscallArg(ThreadContext *tc, int &i)=0
std::string tgtCwd
The cwd members are used to track changes to the current working directory for the purpose of executi...
std::vector< std::string > envp
virtual Process * load(ProcessParams *params, ObjectFile *obj_file)=0
Each subclass needs to implement this method.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
EmulatedDriver * findDriver(std::string filename)
Find an emulated device driver.
This class provides the wrapper interface for the system call implementations which are defined in th...
bool fixupStackFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
EmulationPageTable * pTable
virtual void syscall(ThreadContext *tc, Fault *fault)=0
void operator=(const Loader &)=delete
std::ostream CheckpointOut
Process(ProcessParams *params, EmulationPageTable *pTable, ObjectFile *obj_file)
const char * progName() const
virtual void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *new_p, RegVal flags)
std::string checkPathRedirect(const std::string &filename)
Redirect file path if it matches any keys initialized by system object.
TranslatingPortProxy Object Declaration for SE.
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
virtual bool mmapGrowsDown() const
Does mmap region grow upward or downward from mmapEnd? Most platforms grow downward, but a few (such as Alpha) grow upward instead, so they can override this method to return false.
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value)=0
std::vector< std::string > argv
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
This class represents the return value from an emulated system call, including any errno setting...
Each instance of a Loader subclass will have a chance to try to load an object file when tryLoaders i...
std::shared_ptr< FaultBase > Fault
Abstract superclass for simulation objects.
int ContextID
Globally unique thread context ID.
std::shared_ptr< FDArray > fds
std::vector< EmulatedDriver * > drivers