Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/45243 )

Change subject: arch: Stop using deprecated M5_AT_* constants.
......................................................................

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 <[email protected]>
Maintainer: Gabe Black <[email protected]>
Reviewed-by: Daniel Carvalho <[email protected]>
---
M src/arch/arm/process.cc
M src/arch/mips/process.cc
M src/arch/power/process.cc
M src/arch/riscv/process.cc
M src/arch/sparc/process.cc
M src/arch/x86/process.cc
M src/arch/x86/process.hh
7 files changed, 130 insertions(+), 125 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc
index a9cf4bd..ec00e6b 100644
--- a/src/arch/arm/process.cc
+++ b/src/arch/arm/process.cc
@@ -258,7 +258,7 @@
 {
     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 @@

             //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 @@

     //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 @@
         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);

diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc
index 9810d67..150a163 100644
--- a/src/arch/mips/process.cc
+++ b/src/arch/mips/process.cc
@@ -88,37 +88,37 @@
 {
     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 @@

     // 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 @@
     }

     // 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);

diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc
index d8643ee..810953b 100644
--- a/src/arch/power/process.cc
+++ b/src/arch/power/process.cc
@@ -84,7 +84,7 @@
 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 @@

         //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 @@

     //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 @@
         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);

diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc
index 30aebd6..2142c5c 100644
--- a/src/arch/riscv/process.cc
+++ b/src/arch/riscv/process.cc
@@ -135,16 +135,16 @@
         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 @@

     // 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",
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc
index 51a0b7d..791ade6 100644
--- a/src/arch/sparc/process.cc
+++ b/src/arch/sparc/process.cc
@@ -141,7 +141,7 @@
 {
     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 @@
     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 @@

     // 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 @@
     }

     // 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);

diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index 4119ad8..4635639 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -711,11 +711,11 @@
 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 @@

         // 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 @@
     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 @@
         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 @@
 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);
 }

diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh
index 56f1353..8585f94 100644
--- a/src/arch/x86/process.hh
+++ b/src/arch/x86/process.hh
@@ -50,12 +50,17 @@

 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 @@

         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; }



3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45243
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I26fc0cf1f27c1a1dcae479096b183ab1f5abc8e2
Gerrit-Change-Number: 45243
Gerrit-PatchSet: 7
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to