diff options
Diffstat (limited to 'src/arch/alpha/process.cc')
-rw-r--r-- | src/arch/alpha/process.cc | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 00468bbc3..a7822a367 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -82,8 +82,7 @@ AlphaProcess::argsInit(int intSize, int pageSize) objFile->loadSections(initVirtMem); - typedef AuxVector<uint64_t> auxv_t; - std::vector<auxv_t> auxv; + std::vector<AuxVector<uint64_t>> auxv; ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); if (elfObject) @@ -96,20 +95,21 @@ AlphaProcess::argsInit(int intSize, int pageSize) // seem to be a problem. // check out _dl_aux_init() in glibc/elf/dl-support.c for details // --Lisa - auxv.push_back(auxv_t(M5_AT_PAGESZ, AlphaISA::PageBytes)); - auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); - auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); - DPRINTF(Loader, "auxv at PHDR %08p\n", elfObject->programHeaderTable()); - auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount())); + auxv.emplace_back(M5_AT_PAGESZ, AlphaISA::PageBytes); + auxv.emplace_back(M5_AT_CLKTCK, 100); + auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable()); + DPRINTF(Loader, "auxv at PHDR %08p\n", + elfObject->programHeaderTable()); + auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount()); // This is the base address of the ELF interpreter; it should be // zero for static executables or contain the base address for // dynamic executables. - auxv.push_back(auxv_t(M5_AT_BASE, getBias())); - auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint())); - auxv.push_back(auxv_t(M5_AT_UID, uid())); - auxv.push_back(auxv_t(M5_AT_EUID, euid())); - auxv.push_back(auxv_t(M5_AT_GID, gid())); - auxv.push_back(auxv_t(M5_AT_EGID, egid())); + auxv.emplace_back(M5_AT_BASE, getBias()); + auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint()); + auxv.emplace_back(M5_AT_UID, uid()); + auxv.emplace_back(M5_AT_EUID, euid()); + auxv.emplace_back(M5_AT_GID, gid()); + auxv.emplace_back(M5_AT_EGID, egid()); } @@ -168,11 +168,10 @@ AlphaProcess::argsInit(int intSize, int pageSize) copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); //Copy the aux stuff - for (vector<auxv_t>::size_type x = 0; x < auxv.size(); x++) { - initVirtMem.writeBlob(auxv_array_base + x * 2 * intSize, - (uint8_t*)&(auxv[x].getAuxType()), intSize); - initVirtMem.writeBlob(auxv_array_base + (x * 2 + 1) * intSize, - (uint8_t*)&(auxv[x].getAuxVal()), intSize); + Addr auxv_array_end = auxv_array_base; + for (const auto &aux: auxv) { + initVirtMem.write(auxv_array_end, aux, GuestByteOrder); + auxv_array_end += sizeof(aux); } ThreadContext *tc = system->getThreadContext(contextIds[0]); |