From e1ac9629398027186ef4c2a66772aeff2b4c6792 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 3 Sep 2014 07:42:21 -0400 Subject: arch: Cleanup unused ISA traits constants This patch prunes unused values, and also unifies how the values are defined (not using an enum for ALPHA), aligning the use of int vs Addr etc. The patch also removes the duplication of PageBytes/PageShift and VMPageSize/LogVMPageSize. For all ISAs the two pairs had identical values and the latter has been removed. --- src/arch/arm/isa_traits.hh | 11 ----------- src/arch/arm/process.cc | 10 +++++----- src/arch/arm/utility.cc | 1 + 3 files changed, 6 insertions(+), 16 deletions(-) (limited to 'src/arch/arm') diff --git a/src/arch/arm/isa_traits.hh b/src/arch/arm/isa_traits.hh index 506c5009c..8be2bf04a 100644 --- a/src/arch/arm/isa_traits.hh +++ b/src/arch/arm/isa_traits.hh @@ -51,8 +51,6 @@ namespace LittleEndianGuest {} -#define TARGET_ARM - namespace ArmISA { using namespace LittleEndianGuest; @@ -101,16 +99,7 @@ namespace ArmISA // return a no-op instruction... used for instruction fetch faults const ExtMachInst NoopMachInst = 0x01E320F000ULL; - const int LogVMPageSize = 12; // 4K bytes - const int VMPageSize = (1 << LogVMPageSize); - - // Shouldn't this be 1 because of Thumb?! Dynamic? --Ali - const int BranchPredAddrShiftAmt = 2; // instructions are 4-byte aligned - const int MachineBytes = 4; - const int WordBytes = 4; - const int HalfwordBytes = 2; - const int ByteBytes = 1; const uint32_t HighVecs = 0xFFFF0000; diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc index 175382b43..a08e6ee45 100644 --- a/src/arch/arm/process.cc +++ b/src/arch/arm/process.cc @@ -74,7 +74,7 @@ ArmLiveProcess32::ArmLiveProcess32(LiveProcessParams *params, // Set up break point (Top of Heap) brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); - brk_point = roundUp(brk_point, VMPageSize); + brk_point = roundUp(brk_point, PageBytes); // Set up region for mmaps. For now, start at bottom of kuseg space. mmap_start = mmap_end = 0x40000000L; @@ -91,7 +91,7 @@ ArmLiveProcess64::ArmLiveProcess64(LiveProcessParams *params, // Set up break point (Top of Heap) brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); - brk_point = roundUp(brk_point, VMPageSize); + brk_point = roundUp(brk_point, PageBytes); // Set up region for mmaps. For now, start at bottom of kuseg space. mmap_start = mmap_end = 0x4000000000L; @@ -101,7 +101,7 @@ void ArmLiveProcess32::initState() { LiveProcess::initState(); - argsInit(VMPageSize, INTREG_SP); + argsInit(PageBytes, INTREG_SP); for (int i = 0; i < contextIds.size(); i++) { ThreadContext * tc = system->getThreadContext(contextIds[i]); CPACR cpacr = tc->readMiscReg(MISCREG_CPACR); @@ -120,7 +120,7 @@ void ArmLiveProcess64::initState() { LiveProcess::initState(); - argsInit(VMPageSize, INTREG_SP0); + argsInit(PageBytes, INTREG_SP0); for (int i = 0; i < contextIds.size(); i++) { ThreadContext * tc = system->getThreadContext(contextIds[i]); CPSR cpsr = tc->readMiscReg(MISCREG_CPSR); @@ -203,7 +203,7 @@ ArmLiveProcess::argsInit(int pageSize, IntRegIndex spIndex) //XXX Figure out what these should be auxv.push_back(auxv_t(M5_AT_HWCAP, features)); //The system page size - auxv.push_back(auxv_t(M5_AT_PAGESZ, ArmISA::VMPageSize)); + auxv.push_back(auxv_t(M5_AT_PAGESZ, ArmISA::PageBytes)); //Frequency at which times() increments auxv.push_back(auxv_t(M5_AT_CLKTCK, 0x64)); // For statically linked executables, this is the virtual address of the diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc index ae84391e9..b0eec495c 100644 --- a/src/arch/arm/utility.cc +++ b/src/arch/arm/utility.cc @@ -85,6 +85,7 @@ getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) } } else { if (size == (uint16_t)(-1)) + // todo: should this not be sizeof(uint32_t) rather? size = ArmISA::MachineBytes; if (number < NumArgumentRegs) { -- cgit v1.2.3