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 <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ PowerProcess::initState()
|
||||
{
|
||||
Process::initState();
|
||||
|
||||
argsInit(MachineBytes, PageBytes);
|
||||
argsInit(sizeof(uint32_t), PageBytes);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user