arch: Stop using deprecated M5_AT_* constants.
Also stop using the non-namespaced version of AuxVector. Change-Id: I26fc0cf1f27c1a1dcae479096b183ab1f5abc8e2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45243 Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Gabe Black <gabe.black@gmail.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
@@ -258,7 +258,7 @@ ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
|
||||
{
|
||||
int intSize = sizeof(IntType);
|
||||
|
||||
std::vector<AuxVector<IntType>> auxv;
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> auxv;
|
||||
|
||||
std::string filename;
|
||||
if (argv.size() < 1)
|
||||
@@ -279,41 +279,41 @@ ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
|
||||
|
||||
//Bits which describe the system hardware capabilities
|
||||
//XXX Figure out what these should be
|
||||
auxv.emplace_back(M5_AT_HWCAP, features);
|
||||
auxv.emplace_back(gem5::auxv::Hwcap, features);
|
||||
//Frequency at which times() increments
|
||||
auxv.emplace_back(M5_AT_CLKTCK, 0x64);
|
||||
auxv.emplace_back(gem5::auxv::Clktck, 0x64);
|
||||
//Whether to enable "secure mode" in the executable
|
||||
auxv.emplace_back(M5_AT_SECURE, 0);
|
||||
auxv.emplace_back(gem5::auxv::Secure, 0);
|
||||
// Pointer to 16 bytes of random data
|
||||
auxv.emplace_back(M5_AT_RANDOM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Random, 0);
|
||||
//The filename of the program
|
||||
auxv.emplace_back(M5_AT_EXECFN, 0);
|
||||
auxv.emplace_back(gem5::auxv::Execfn, 0);
|
||||
//The string "v71" -- ARM v7 architecture
|
||||
auxv.emplace_back(M5_AT_PLATFORM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Platform, 0);
|
||||
}
|
||||
|
||||
//The system page size
|
||||
auxv.emplace_back(M5_AT_PAGESZ, ArmISA::PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, ArmISA::PageBytes);
|
||||
// For statically linked executables, this is the virtual address of
|
||||
// the program header tables if they appear in the executable image
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
// This is the size of a program header entry from the elf file.
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
// This is the number of program headers from the original elf file.
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::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.emplace_back(M5_AT_BASE, getBias());
|
||||
auxv.emplace_back(gem5::auxv::Base, getBias());
|
||||
//XXX Figure out what this should be.
|
||||
auxv.emplace_back(M5_AT_FLAGS, 0);
|
||||
auxv.emplace_back(gem5::auxv::Flags, 0);
|
||||
//The entry point to the program
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
//Different user and group IDs
|
||||
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());
|
||||
auxv.emplace_back(gem5::auxv::Uid, uid());
|
||||
auxv.emplace_back(gem5::auxv::Euid, euid());
|
||||
auxv.emplace_back(gem5::auxv::Gid, gid());
|
||||
auxv.emplace_back(gem5::auxv::Egid, egid());
|
||||
}
|
||||
|
||||
//Figure out how big the initial stack nedes to be
|
||||
@@ -414,13 +414,13 @@ ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
|
||||
|
||||
//Fix up the aux vectors which point to other data
|
||||
for (int i = auxv.size() - 1; i >= 0; i--) {
|
||||
if (auxv[i].type == M5_AT_PLATFORM) {
|
||||
if (auxv[i].type == gem5::auxv::Platform) {
|
||||
auxv[i].val = platform_base;
|
||||
initVirtMem->writeString(platform_base, platform.c_str());
|
||||
} else if (auxv[i].type == M5_AT_EXECFN) {
|
||||
} else if (auxv[i].type == gem5::auxv::Execfn) {
|
||||
auxv[i].val = aux_data_base;
|
||||
initVirtMem->writeString(aux_data_base, filename.c_str());
|
||||
} else if (auxv[i].type == M5_AT_RANDOM) {
|
||||
} else if (auxv[i].type == gem5::auxv::Random) {
|
||||
auxv[i].val = aux_random_base;
|
||||
// Just leave the value 0, we don't want randomness
|
||||
}
|
||||
@@ -433,7 +433,7 @@ ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
|
||||
auxv_array_end += sizeof(aux);
|
||||
}
|
||||
//Write out the terminating zeroed auxillary vector
|
||||
const AuxVector<IntType> zero(0, 0);
|
||||
const gem5::auxv::AuxVector<IntType> zero(0, 0);
|
||||
initVirtMem->write(auxv_array_end, zero);
|
||||
auxv_array_end += sizeof(zero);
|
||||
|
||||
|
||||
@@ -88,37 +88,37 @@ MipsProcess::argsInit(int pageSize)
|
||||
{
|
||||
int intSize = sizeof(IntType);
|
||||
|
||||
std::vector<AuxVector<IntType>> auxv;
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> auxv;
|
||||
|
||||
auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
|
||||
if (elfObject)
|
||||
{
|
||||
// Set the system page size
|
||||
auxv.emplace_back(M5_AT_PAGESZ, MipsISA::PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, MipsISA::PageBytes);
|
||||
// Set the frequency at which time() increments
|
||||
auxv.emplace_back(M5_AT_CLKTCK, 100);
|
||||
auxv.emplace_back(gem5::auxv::Clktck, 100);
|
||||
// For statically linked executables, this is the virtual
|
||||
// address of the program header tables if they appear in the
|
||||
// executable image.
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
DPRINTF(Loader, "auxv at PHDR %08p\n",
|
||||
elfObject->programHeaderTable());
|
||||
// This is the size of a program header entry from the elf file.
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
// This is the number of program headers from the original elf file.
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::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.emplace_back(M5_AT_BASE, getBias());
|
||||
auxv.emplace_back(gem5::auxv::Base, getBias());
|
||||
//The entry point to the program
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
//Different user and group IDs
|
||||
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());
|
||||
auxv.emplace_back(M5_AT_RANDOM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Uid, uid());
|
||||
auxv.emplace_back(gem5::auxv::Euid, euid());
|
||||
auxv.emplace_back(gem5::auxv::Gid, gid());
|
||||
auxv.emplace_back(gem5::auxv::Egid, egid());
|
||||
auxv.emplace_back(gem5::auxv::Random, 0);
|
||||
}
|
||||
|
||||
// Calculate how much space we need for arg & env & auxv arrays.
|
||||
@@ -179,7 +179,7 @@ MipsProcess::argsInit(int pageSize)
|
||||
|
||||
// Fix up the aux vectors which point to data.
|
||||
for (auto &aux: auxv) {
|
||||
if (aux.type == M5_AT_RANDOM)
|
||||
if (aux.type == gem5::auxv::Random)
|
||||
aux.val = aux_data_base;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ MipsProcess::argsInit(int pageSize)
|
||||
}
|
||||
|
||||
// Write out the terminating zeroed auxilliary vector
|
||||
const AuxVector<IntType> zero(0, 0);
|
||||
const gem5::auxv::AuxVector<IntType> zero(0, 0);
|
||||
initVirtMem->write(auxv_array_end, zero);
|
||||
auxv_array_end += sizeof(zero);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ PowerProcess::initState()
|
||||
void
|
||||
PowerProcess::argsInit(int intSize, int pageSize)
|
||||
{
|
||||
std::vector<AuxVector<uint32_t>> auxv;
|
||||
std::vector<gem5::auxv::AuxVector<uint32_t>> auxv;
|
||||
|
||||
std::string filename;
|
||||
if (argv.size() < 1)
|
||||
@@ -107,39 +107,39 @@ PowerProcess::argsInit(int intSize, int pageSize)
|
||||
|
||||
//Bits which describe the system hardware capabilities
|
||||
//XXX Figure out what these should be
|
||||
auxv.emplace_back(M5_AT_HWCAP, features);
|
||||
auxv.emplace_back(gem5::auxv::Hwcap, features);
|
||||
//The system page size
|
||||
auxv.emplace_back(M5_AT_PAGESZ, PowerISA::PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, PowerISA::PageBytes);
|
||||
//Frequency at which times() increments
|
||||
auxv.emplace_back(M5_AT_CLKTCK, 0x64);
|
||||
auxv.emplace_back(gem5::auxv::Clktck, 0x64);
|
||||
// For statically linked executables, this is the virtual address of
|
||||
// the program header tables if they appear in the executable image
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
// This is the size of a program header entry from the elf file.
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
// This is the number of program headers from the original elf file.
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::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.emplace_back(M5_AT_BASE, getBias());
|
||||
auxv.emplace_back(gem5::auxv::Base, getBias());
|
||||
//XXX Figure out what this should be.
|
||||
auxv.emplace_back(M5_AT_FLAGS, 0);
|
||||
auxv.emplace_back(gem5::auxv::Flags, 0);
|
||||
//The entry point to the program
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
//Different user and group IDs
|
||||
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());
|
||||
auxv.emplace_back(gem5::auxv::Uid, uid());
|
||||
auxv.emplace_back(gem5::auxv::Euid, euid());
|
||||
auxv.emplace_back(gem5::auxv::Gid, gid());
|
||||
auxv.emplace_back(gem5::auxv::Egid, egid());
|
||||
//Whether to enable "secure mode" in the executable
|
||||
auxv.emplace_back(M5_AT_SECURE, 0);
|
||||
auxv.emplace_back(gem5::auxv::Secure, 0);
|
||||
//The address of 16 "random" bytes
|
||||
auxv.emplace_back(M5_AT_RANDOM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Random, 0);
|
||||
//The filename of the program
|
||||
auxv.emplace_back(M5_AT_EXECFN, 0);
|
||||
auxv.emplace_back(gem5::auxv::Execfn, 0);
|
||||
//The string "v51" with unknown meaning
|
||||
auxv.emplace_back(M5_AT_PLATFORM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Platform, 0);
|
||||
}
|
||||
|
||||
//Figure out how big the initial stack nedes to be
|
||||
@@ -239,13 +239,13 @@ PowerProcess::argsInit(int intSize, int pageSize)
|
||||
|
||||
//Fix up the aux vectors which point to other data
|
||||
for (int i = auxv.size() - 1; i >= 0; i--) {
|
||||
if (auxv[i].type == M5_AT_PLATFORM) {
|
||||
if (auxv[i].type == gem5::auxv::Platform) {
|
||||
auxv[i].val = platform_base;
|
||||
initVirtMem->writeString(platform_base, platform.c_str());
|
||||
} else if (auxv[i].type == M5_AT_EXECFN) {
|
||||
} else if (auxv[i].type == gem5::auxv::Execfn) {
|
||||
auxv[i].val = aux_data_base + numRandomBytes;
|
||||
initVirtMem->writeString(aux_data_base, filename.c_str());
|
||||
} else if (auxv[i].type == M5_AT_RANDOM) {
|
||||
} else if (auxv[i].type == gem5::auxv::Random) {
|
||||
auxv[i].val = aux_data_base;
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ PowerProcess::argsInit(int intSize, int pageSize)
|
||||
auxv_array_end += sizeof(aux);
|
||||
}
|
||||
//Write out the terminating zeroed auxilliary vector
|
||||
const AuxVector<uint64_t> zero(0, 0);
|
||||
const gem5::auxv::AuxVector<uint64_t> zero(0, 0);
|
||||
initVirtMem->write(auxv_array_end, zero);
|
||||
auxv_array_end += sizeof(zero);
|
||||
|
||||
|
||||
@@ -135,16 +135,16 @@ RiscvProcess::argsInit(int pageSize)
|
||||
stack_top -= env.size() + 1;
|
||||
stack_top &= -addrSize;
|
||||
|
||||
std::vector<AuxVector<IntType>> auxv;
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> auxv;
|
||||
if (elfObject != nullptr) {
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(M5_AT_PAGESZ, PageBytes);
|
||||
auxv.emplace_back(M5_AT_SECURE, 0);
|
||||
auxv.emplace_back(M5_AT_RANDOM, stack_top);
|
||||
auxv.emplace_back(M5_AT_NULL, 0);
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Phnum, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Secure, 0);
|
||||
auxv.emplace_back(gem5::auxv::Random, stack_top);
|
||||
auxv.emplace_back(gem5::auxv::Null, 0);
|
||||
}
|
||||
stack_top -= (1 + argv.size()) * addrSize +
|
||||
(1 + envp.size()) * addrSize +
|
||||
@@ -223,14 +223,14 @@ RiscvProcess::argsInit(int pageSize)
|
||||
|
||||
// Push aux vector onto stack
|
||||
std::map<IntType, std::string> aux_keys = {
|
||||
{M5_AT_ENTRY, "M5_AT_ENTRY"},
|
||||
{M5_AT_PHNUM, "M5_AT_PHNUM"},
|
||||
{M5_AT_PHENT, "M5_AT_PHENT"},
|
||||
{M5_AT_PHDR, "M5_AT_PHDR"},
|
||||
{M5_AT_PAGESZ, "M5_AT_PAGESZ"},
|
||||
{M5_AT_SECURE, "M5_AT_SECURE"},
|
||||
{M5_AT_RANDOM, "M5_AT_RANDOM"},
|
||||
{M5_AT_NULL, "M5_AT_NULL"}
|
||||
{gem5::auxv::Entry, "gem5::auxv::Entry"},
|
||||
{gem5::auxv::Phnum, "gem5::auxv::Phnum"},
|
||||
{gem5::auxv::Phent, "gem5::auxv::Phent"},
|
||||
{gem5::auxv::Phdr, "gem5::auxv::Phdr"},
|
||||
{gem5::auxv::Pagesz, "gem5::auxv::Pagesz"},
|
||||
{gem5::auxv::Secure, "gem5::auxv::Secure"},
|
||||
{gem5::auxv::Random, "gem5::auxv::Random"},
|
||||
{gem5::auxv::Null, "gem5::auxv::Null"}
|
||||
};
|
||||
for (const auto &aux: auxv) {
|
||||
DPRINTF(Stack, "Wrote aux key %s to address %#x\n",
|
||||
|
||||
@@ -141,7 +141,7 @@ SparcProcess::argsInit(int pageSize)
|
||||
{
|
||||
int intSize = sizeof(IntType);
|
||||
|
||||
std::vector<AuxVector<IntType>> auxv;
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> auxv;
|
||||
|
||||
std::string filename;
|
||||
if (argv.size() < 1)
|
||||
@@ -179,36 +179,36 @@ SparcProcess::argsInit(int pageSize)
|
||||
auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
|
||||
if (elfObject) {
|
||||
// Bits which describe the system hardware capabilities
|
||||
auxv.emplace_back(M5_AT_HWCAP, hwcap);
|
||||
auxv.emplace_back(gem5::auxv::Hwcap, hwcap);
|
||||
// The system page size
|
||||
auxv.emplace_back(M5_AT_PAGESZ, SparcISA::PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, SparcISA::PageBytes);
|
||||
// Defined to be 100 in the kernel source.
|
||||
// Frequency at which times() increments
|
||||
auxv.emplace_back(M5_AT_CLKTCK, 100);
|
||||
auxv.emplace_back(gem5::auxv::Clktck, 100);
|
||||
// For statically linked executables, this is the virtual address of
|
||||
// the program header tables if they appear in the executable image
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
// This is the size of a program header entry from the elf file.
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
// This is the number of program headers from the original elf file.
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::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.emplace_back(M5_AT_BASE, getBias());
|
||||
auxv.emplace_back(gem5::auxv::Base, getBias());
|
||||
// This is hardwired to 0 in the elf loading code in the kernel
|
||||
auxv.emplace_back(M5_AT_FLAGS, 0);
|
||||
auxv.emplace_back(gem5::auxv::Flags, 0);
|
||||
// The entry point to the program
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
// Different user and group IDs
|
||||
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());
|
||||
auxv.emplace_back(gem5::auxv::Uid, uid());
|
||||
auxv.emplace_back(gem5::auxv::Euid, euid());
|
||||
auxv.emplace_back(gem5::auxv::Gid, gid());
|
||||
auxv.emplace_back(gem5::auxv::Egid, egid());
|
||||
// Whether to enable "secure mode" in the executable
|
||||
auxv.emplace_back(M5_AT_SECURE, 0);
|
||||
auxv.emplace_back(gem5::auxv::Secure, 0);
|
||||
// The address of 16 "random" bytes.
|
||||
auxv.emplace_back(M5_AT_RANDOM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Random, 0);
|
||||
}
|
||||
|
||||
// Figure out how big the initial stack needs to be
|
||||
@@ -318,7 +318,7 @@ SparcProcess::argsInit(int pageSize)
|
||||
|
||||
// Fix up the aux vectors which point to data.
|
||||
for (auto &aux: auxv) {
|
||||
if (aux.type == M5_AT_RANDOM)
|
||||
if (aux.type == gem5::auxv::Random)
|
||||
aux.val = aux_data_base;
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ SparcProcess::argsInit(int pageSize)
|
||||
}
|
||||
|
||||
// Write out the terminating zeroed auxilliary vector
|
||||
const AuxVector<IntType> zero(0, 0);
|
||||
const gem5::auxv::AuxVector<IntType> zero(0, 0);
|
||||
initVirtMem->write(auxv_array_end, zero);
|
||||
auxv_array_end += sizeof(zero);
|
||||
|
||||
|
||||
@@ -711,11 +711,11 @@ I386Process::initState()
|
||||
template<class IntType>
|
||||
void
|
||||
X86Process::argsInit(int pageSize,
|
||||
std::vector<AuxVector<IntType> > extraAuxvs)
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> extraAuxvs)
|
||||
{
|
||||
int intSize = sizeof(IntType);
|
||||
|
||||
std::vector<AuxVector<IntType>> auxv = extraAuxvs;
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> auxv = extraAuxvs;
|
||||
|
||||
std::string filename;
|
||||
if (argv.size() < 1)
|
||||
@@ -806,40 +806,40 @@ X86Process::argsInit(int pageSize,
|
||||
|
||||
// Bits which describe the system hardware capabilities
|
||||
// XXX Figure out what these should be
|
||||
auxv.emplace_back(M5_AT_HWCAP, features);
|
||||
auxv.emplace_back(gem5::auxv::Hwcap, features);
|
||||
// The system page size
|
||||
auxv.emplace_back(M5_AT_PAGESZ, X86ISA::PageBytes);
|
||||
auxv.emplace_back(gem5::auxv::Pagesz, X86ISA::PageBytes);
|
||||
// Frequency at which times() increments
|
||||
// Defined to be 100 in the kernel source.
|
||||
auxv.emplace_back(M5_AT_CLKTCK, 100);
|
||||
auxv.emplace_back(gem5::auxv::Clktck, 100);
|
||||
// This is the virtual address of the program header tables if they
|
||||
// appear in the executable image.
|
||||
auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
|
||||
auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
|
||||
// This is the size of a program header entry from the elf file.
|
||||
auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
|
||||
auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
|
||||
// This is the number of program headers from the original elf file.
|
||||
auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
|
||||
auxv.emplace_back(gem5::auxv::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.emplace_back(M5_AT_BASE, getBias());
|
||||
auxv.emplace_back(gem5::auxv::Base, getBias());
|
||||
// XXX Figure out what this should be.
|
||||
auxv.emplace_back(M5_AT_FLAGS, 0);
|
||||
auxv.emplace_back(gem5::auxv::Flags, 0);
|
||||
// The entry point to the program
|
||||
auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
|
||||
auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
|
||||
// Different user and group IDs
|
||||
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());
|
||||
auxv.emplace_back(gem5::auxv::Uid, uid());
|
||||
auxv.emplace_back(gem5::auxv::Euid, euid());
|
||||
auxv.emplace_back(gem5::auxv::Gid, gid());
|
||||
auxv.emplace_back(gem5::auxv::Egid, egid());
|
||||
// Whether to enable "secure mode" in the executable
|
||||
auxv.emplace_back(M5_AT_SECURE, 0);
|
||||
auxv.emplace_back(gem5::auxv::Secure, 0);
|
||||
// The address of 16 "random" bytes.
|
||||
auxv.emplace_back(M5_AT_RANDOM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Random, 0);
|
||||
// The name of the program
|
||||
auxv.emplace_back(M5_AT_EXECFN, 0);
|
||||
auxv.emplace_back(gem5::auxv::Execfn, 0);
|
||||
// The platform string
|
||||
auxv.emplace_back(M5_AT_PLATFORM, 0);
|
||||
auxv.emplace_back(gem5::auxv::Platform, 0);
|
||||
}
|
||||
|
||||
// Figure out how big the initial stack needs to be
|
||||
@@ -953,11 +953,11 @@ X86Process::argsInit(int pageSize,
|
||||
initVirtMem->writeString(file_name_base, filename.c_str());
|
||||
|
||||
// Fix up the aux vectors which point to data
|
||||
assert(auxv[auxv.size() - 3].type == M5_AT_RANDOM);
|
||||
assert(auxv[auxv.size() - 3].type == gem5::auxv::Random);
|
||||
auxv[auxv.size() - 3].val = aux_data_base;
|
||||
assert(auxv[auxv.size() - 2].type == M5_AT_EXECFN);
|
||||
assert(auxv[auxv.size() - 2].type == gem5::auxv::Execfn);
|
||||
auxv[auxv.size() - 2].val = argv_array_base;
|
||||
assert(auxv[auxv.size() - 1].type == M5_AT_PLATFORM);
|
||||
assert(auxv[auxv.size() - 1].type == gem5::auxv::Platform);
|
||||
auxv[auxv.size() - 1].val = aux_data_base + numRandomBytes;
|
||||
|
||||
|
||||
@@ -968,7 +968,7 @@ X86Process::argsInit(int pageSize,
|
||||
auxv_array_end += sizeof(aux);
|
||||
}
|
||||
// Write out the terminating zeroed auxiliary vector
|
||||
const AuxVector<uint64_t> zero(0, 0);
|
||||
const gem5::auxv::AuxVector<uint64_t> zero(0, 0);
|
||||
initVirtMem->write(auxv_array_end, zero);
|
||||
auxv_array_end += sizeof(zero);
|
||||
|
||||
@@ -996,19 +996,19 @@ X86Process::argsInit(int pageSize,
|
||||
void
|
||||
X86_64Process::argsInit(int pageSize)
|
||||
{
|
||||
std::vector<AuxVector<uint64_t> > extraAuxvs;
|
||||
extraAuxvs.emplace_back(M5_AT_SYSINFO_EHDR, vsyscallPage.base);
|
||||
std::vector<gem5::auxv::AuxVector<uint64_t> > extraAuxvs;
|
||||
extraAuxvs.emplace_back(auxv::SysinfoEhdr, vsyscallPage.base);
|
||||
X86Process::argsInit<uint64_t>(pageSize, extraAuxvs);
|
||||
}
|
||||
|
||||
void
|
||||
I386Process::argsInit(int pageSize)
|
||||
{
|
||||
std::vector<AuxVector<uint32_t> > extraAuxvs;
|
||||
std::vector<gem5::auxv::AuxVector<uint32_t> > extraAuxvs;
|
||||
//Tell the binary where the vsyscall part of the vsyscall page is.
|
||||
extraAuxvs.emplace_back(M5_AT_SYSINFO,
|
||||
extraAuxvs.emplace_back(auxv::Sysinfo,
|
||||
vsyscallPage.base + vsyscallPage.vsyscallOffset);
|
||||
extraAuxvs.emplace_back(M5_AT_SYSINFO_EHDR, vsyscallPage.base);
|
||||
extraAuxvs.emplace_back(auxv::SysinfoEhdr, vsyscallPage.base);
|
||||
X86Process::argsInit<uint32_t>(pageSize, extraAuxvs);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +50,17 @@ class SyscallDesc;
|
||||
|
||||
namespace X86ISA
|
||||
{
|
||||
namespace auxv
|
||||
{
|
||||
|
||||
enum X86AuxiliaryVectorTypes
|
||||
{
|
||||
M5_AT_SYSINFO = 32,
|
||||
M5_AT_SYSINFO_EHDR = 33
|
||||
Sysinfo = 32,
|
||||
SysinfoEhdr = 33
|
||||
};
|
||||
|
||||
} // namespace auxv
|
||||
|
||||
class X86Process : public Process
|
||||
{
|
||||
protected:
|
||||
@@ -66,7 +71,7 @@ namespace X86ISA
|
||||
|
||||
template<class IntType>
|
||||
void argsInit(int pageSize,
|
||||
std::vector<AuxVector<IntType> > extraAuxvs);
|
||||
std::vector<gem5::auxv::AuxVector<IntType>> extraAuxvs);
|
||||
|
||||
public:
|
||||
Addr gdtStart() const { return _gdtStart; }
|
||||
|
||||
Reference in New Issue
Block a user