summaryrefslogtreecommitdiff
path: root/src/arch/arm/tlb.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-11-15 14:04:03 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2010-11-15 14:04:03 -0600
commit13931b9b827abd8a9fba5cb4448b69066746637c (patch)
tree348231f50e7e0fd224fdf255b3c0a2159097750f /src/arch/arm/tlb.hh
parent4c2e5c282b334dcd263373c48d325c7f77847c61 (diff)
downloadgem5-13931b9b827abd8a9fba5cb4448b69066746637c.tar.xz
ARM: Cache the misc regs at the TLB to limit readMiscReg() calls.
Diffstat (limited to 'src/arch/arm/tlb.hh')
-rw-r--r--src/arch/arm/tlb.hh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/arch/arm/tlb.hh b/src/arch/arm/tlb.hh
index a6803c415..0b8bc1046 100644
--- a/src/arch/arm/tlb.hh
+++ b/src/arch/arm/tlb.hh
@@ -208,6 +208,32 @@ class TLB : public BaseTLB
void unserialize(Checkpoint *cp, const std::string &section);
void regStats();
+
+ // Caching misc register values here.
+ // Writing to misc registers needs to invalidate them.
+ // translateFunctional/translateSe/translateFs checks if they are
+ // invalid and call updateMiscReg if necessary.
+protected:
+ SCTLR sctlr;
+ bool isPriv;
+ uint32_t contextId;
+ PRRR prrr;
+ NMRR nmrr;
+ uint32_t dacr;
+ bool miscRegValid;
+ void updateMiscReg(ThreadContext *tc)
+ {
+ sctlr = tc->readMiscReg(MISCREG_SCTLR);
+ CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
+ isPriv = cpsr.mode != MODE_USER;
+ contextId = tc->readMiscReg(MISCREG_CONTEXTIDR);
+ prrr = tc->readMiscReg(MISCREG_PRRR);
+ nmrr = tc->readMiscReg(MISCREG_NMRR);
+ dacr = tc->readMiscReg(MISCREG_DACR);
+ miscRegValid = true;
+ }
+public:
+ inline void invalidateMiscReg() { miscRegValid = false; }
};
/* namespace ArmISA */ }