From a62b32820e00337bf793e490ede2ec2dcd5e56ee Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 21 Aug 2020 21:13:59 -0700 Subject: [PATCH] power: Tidy up isa_traits.hh and delete the VAddr class. The VAddr class wasn't used and was just a copy (with style fixes) of the Alpha version. Delete unused constants in isa_traits.hh, and remove unnecessary includes. Replace MachineBytes with sizeof(uint32_t) in arch/power/process.cc. Change-Id: Ia4862448c43b2dd07078b1ebbbbfda4636343730 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33199 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/power/isa_traits.hh | 13 -------- src/arch/power/pagetable.hh | 63 ------------------------------------ src/arch/power/process.cc | 2 +- 3 files changed, 1 insertion(+), 77 deletions(-) diff --git a/src/arch/power/isa_traits.hh b/src/arch/power/isa_traits.hh index 0c82af2e0..ba7b2f390 100644 --- a/src/arch/power/isa_traits.hh +++ b/src/arch/power/isa_traits.hh @@ -31,28 +31,15 @@ #ifndef __ARCH_POWER_ISA_TRAITS_HH__ #define __ARCH_POWER_ISA_TRAITS_HH__ -#include "arch/power/types.hh" #include "base/types.hh" -#include "cpu/static_inst_fwd.hh" namespace PowerISA { const ByteOrder GuestByteOrder = BigEndianByteOrder; -StaticInstPtr decodeInst(ExtMachInst); - const Addr PageShift = 12; const Addr PageBytes = ULL(1) << PageShift; -const Addr Page_Mask = ~(PageBytes - 1); -const Addr PageOffset = PageBytes - 1; - -const Addr PteShift = 3; -const Addr NPtePageShift = PageShift - PteShift; -const Addr NPtePage = ULL(1) << NPtePageShift; -const Addr PteMask = NPtePage - 1; - -const int MachineBytes = 4; } // namespace PowerISA diff --git a/src/arch/power/pagetable.hh b/src/arch/power/pagetable.hh index 3aecf1124..f4ec525d8 100644 --- a/src/arch/power/pagetable.hh +++ b/src/arch/power/pagetable.hh @@ -38,69 +38,6 @@ namespace PowerISA { -static inline Addr PteAddr(Addr a) { return (a & PteMask) << PteShift; } - -struct VAddr -{ - static const int ImplBits = 43; - static const Addr ImplMask = (ULL(1) << ImplBits) - 1; - static const Addr UnImplMask = ~ImplMask; - - Addr addr; - - VAddr(Addr a) - : addr(a) - {} - - operator Addr() const - { - return addr; - } - - const VAddr - &operator=(Addr a) - { - addr = a; - return *this; - } - - Addr - vpn() const - { - return (addr & ImplMask) >> PageShift; - } - - Addr - page() const - { - return addr & Page_Mask; - } - - Addr - offset() const - { - return addr & PageOffset; - } - - Addr - level3() const - { - return PowerISA::PteAddr(addr >> PageShift); - } - - Addr - level2() const - { - return PowerISA::PteAddr(addr >> (NPtePageShift + PageShift)); - } - - Addr - level1() const - { - return PowerISA::PteAddr(addr >> (2 * NPtePageShift + PageShift)); - } -}; - // ITB/DTB page table entry struct PTE { diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index 767c3ebef..8168482c4 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -77,7 +77,7 @@ PowerProcess::initState() { Process::initState(); - argsInit(MachineBytes, PageBytes); + argsInit(sizeof(uint32_t), PageBytes); } void -- 2.30.2