39 #include "debug/Loader.hh"
47 using namespace AlphaISA;
62 Addr mmap_end = 0x10000;
64 Addr max_stack_size = 8 * 1024 * 1024;
67 Addr next_thread_stack_base = stack_base - max_stack_size;
69 memState = make_shared<MemState>(brk_point, stack_base, max_stack_size,
70 next_thread_stack_base, mmap_end);
113 int argv_array_size = intSize * (
argv.size() + 1);
114 int envp_array_size = intSize * (
envp.size() + 1);
115 int auxv_array_size = intSize * 2 * (auxv.size() + 1);
117 int arg_data_size = 0;
119 arg_data_size +=
argv[
i].size() + 1;
121 int env_data_size = 0;
123 env_data_size +=
envp[
i].size() + 1;
133 if (space_needed < 32*1024)
134 space_needed = 32*1024;
146 Addr argv_array_base =
memState->getStackMin() + intSize;
147 Addr envp_array_base = argv_array_base + argv_array_size;
148 Addr auxv_array_base = envp_array_base + envp_array_size;
149 Addr arg_data_base = auxv_array_base + auxv_array_size;
150 Addr env_data_base = arg_data_base + arg_data_size;
153 uint64_t argc =
argv.size();
155 argc =
htog((uint64_t)argc);
156 else if (intSize == 4)
157 argc =
htog((uint32_t)argc);
159 panic(
"Unknown int size");
169 (uint8_t*)&(auxv[
x].a_type), intSize);
171 (uint8_t*)&(auxv[
x].a_val), intSize);
void loadState(CheckpointIn &cp) override
loadState() is called on each SimObject when restoring from a checkpoint.
Addr programHeaderTable()
AlphaISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override
std::vector< ContextID > contextIds
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
SETranslatingPortProxy initVirtMem
void setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val) override
virtual void setIntReg(int reg_idx, uint64_t val)=0
Addr globalPointer() const
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
virtual TheISA::PCState pcState()=0
T roundUp(const T &val, const U &align)
std::shared_ptr< MemState > memState
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual uint64_t readIntReg(int reg_idx)=0
int64_t returnValue() const
The return value.
int errnoValue() const
The errno value.
const RegIndex StackPointerReg
T roundDown(const T &val, const U &align)
std::vector< std::string > envp
ThreadContext * getThreadContext(ContextID tid)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual bool loadSections(PortProxy &mem_proxy, Addr mask=maxAddr, Addr offset=0)
void copyStringArray(std::vector< std::string > &strings, AddrType array_ptr, AddrType data_ptr, SETranslatingPortProxy &memProxy)
AlphaProcess(ProcessParams *params, ObjectFile *objFile)
Declarations of a non-full system Page Table.
uint16_t programHeaderCount()
static const int FirstArgumentReg
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override
void argsInit(int intSize, int pageSize)
const RegIndex ReturnValueReg
std::vector< std::string > argv
This class represents the return value from an emulated system call, including any errno setting...
const RegIndex GlobalPointerReg
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val)=0
bool successful() const
Was the system call successful?
const RegIndex SyscallSuccessReg
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
virtual void loadState(CheckpointIn &cp)
loadState() is called on each SimObject when restoring from a checkpoint.
virtual void writeBlob(Addr addr, const uint8_t *p, int size) const
Write size bytes from p to address.