diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2010-10-01 16:03:27 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2010-10-01 16:03:27 -0500 |
commit | 521d68c82a2399bfe32f282aa58708103369b99c (patch) | |
tree | e1856347d34b43c3064cfbc898f92284527616d2 /src/arch/arm/tlb.cc | |
parent | 518b5e5b1c71259ce0badc29f98db46a73c59442 (diff) | |
download | gem5-521d68c82a2399bfe32f282aa58708103369b99c.tar.xz |
ARM: Implement functional virtual to physical address translation
for debugging and program introspection.
Diffstat (limited to 'src/arch/arm/tlb.cc')
-rw-r--r-- | src/arch/arm/tlb.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc index a48805c81..a8d78308f 100644 --- a/src/arch/arm/tlb.cc +++ b/src/arch/arm/tlb.cc @@ -84,8 +84,19 @@ TLB::~TLB() delete [] table; } +bool +TLB::translateFunctional(ThreadContext *tc, Addr va, Addr &pa) +{ + uint32_t context_id = tc->readMiscReg(MISCREG_CONTEXTIDR); + TlbEntry *e = lookup(va, context_id, true); + if (!e) + return false; + pa = e->pAddr(va); + return true; +} + TlbEntry* -TLB::lookup(Addr va, uint8_t cid) +TLB::lookup(Addr va, uint8_t cid, bool functional) { // XXX This should either turn into a TlbMap or add caching @@ -97,7 +108,7 @@ TLB::lookup(Addr va, uint8_t cid) while (retval == NULL && x < size) { if (table[x].match(va, cid)) { retval = &table[x]; - if (x == nlu) + if (x == nlu && !functional) nextnlu(); break; |