#include <algorithm>
+#include "arch/sparc/mmu.hh"
#include "arch/sparc/process.hh"
#include "arch/sparc/se_workload.hh"
-#include "arch/sparc/tlb.hh"
#include "arch/sparc/types.hh"
#include "base/bitfield.hh"
#include "base/trace.hh"
// false for syscall emulation mode regardless of whether the
// address is real in preceding code. Not sure sure that this is
// correct, but also not sure if it matters at all.
- dynamic_cast<TLB *>(tc->getITBPtr())->
- insert(alignedvaddr, partition_id, context_id, false, entry.pte);
+ static_cast<MMU *>(tc->getMMUPtr())->insertItlbEntry(
+ alignedvaddr, partition_id, context_id,
+ false, entry.pte);
}
void
// false for syscall emulation mode regardless of whether the
// address is real in preceding code. Not sure sure that this is
// correct, but also not sure if it matters at all.
- dynamic_cast<TLB *>(tc->getDTBPtr())->
- insert(alignedvaddr, partition_id, context_id, false, entry.pte);
+ static_cast<MMU *>(tc->getMMUPtr())->insertDtlbEntry(
+ alignedvaddr, partition_id, context_id,
+ false, entry.pte);
}
void
#define __ARCH_SPARC_MMU_HH__
#include "arch/generic/mmu.hh"
+#include "arch/sparc/tlb.hh"
#include "params/SparcMMU.hh"
MMU(const SparcMMUParams &p)
: BaseMMU(p)
{}
+
+ void
+ insertItlbEntry(Addr vpn, int partition_id, int context_id, bool real,
+ const PageTableEntry& PTE, int entry=-1)
+ {
+ static_cast<TLB*>(itb)->insert(vpn, partition_id,
+ context_id, real, PTE, entry);
+ }
+
+ void
+ insertDtlbEntry(Addr vpn, int partition_id, int context_id, bool real,
+ const PageTableEntry& PTE, int entry=-1)
+ {
+ static_cast<TLB*>(dtb)->insert(vpn, partition_id,
+ context_id, real, PTE, entry);
+ }
};
} // namespace SparcISA
#include "arch/sparc/asi.hh"
#include "arch/sparc/faults.hh"
#include "arch/sparc/interrupts.hh"
+#include "arch/sparc/mmu.hh"
#include "arch/sparc/registers.hh"
#include "base/bitfield.hh"
#include "base/compiler.hh"
DPRINTF(IPR, "Memory Mapped IPR Read: asi=%#X a=%#x\n",
(uint32_t)pkt->req->getArchFlags(), pkt->getAddr());
- TLB *itb = dynamic_cast<TLB *>(tc->getITBPtr());
+ TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
switch (asi) {
case ASI_LSU_CONTROL_REG:
DPRINTF(IPR, "Memory Mapped IPR Write: asi=%#X a=%#x d=%#X\n",
(uint32_t)asi, va, data);
- TLB *itb = dynamic_cast<TLB *>(tc->getITBPtr());
+ TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
switch (asi) {
case ASI_LSU_CONTROL_REG:
TLB::GetTsbPtr(ThreadContext *tc, Addr addr, int ctx, Addr *ptrs)
{
uint64_t tag_access = mbits(addr,63,13) | mbits(ctx,12,0);
- TLB *itb = dynamic_cast<TLB *>(tc->getITBPtr());
+ TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
ptrs[0] = MakeTsbPtr(Ps0, tag_access,
c0_tsb_ps0,
c0_config,
class TLB : public BaseTLB
{
- // These faults need to be able to populate the tlb in SE mode.
- friend class FastInstructionAccessMMUMiss;
- friend class FastDataAccessMMUMiss;
+ friend class MMU;
// TLB state
protected: