From 9b49a78cfdc0bd6f8afdb0d066ea39778095d7ac Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 26 Aug 2007 20:33:57 -0700 Subject: Address translation: Make the page table more flexible. The page table now stores actual page table entries. It is still a templated class here, but this will be corrected in the near future. --HG-- extra : convert_revision : 804dcc6320414c2b3ab76a74a15295bd24e1d13d --- src/arch/alpha/tlb.hh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src/arch/alpha/tlb.hh') diff --git a/src/arch/alpha/tlb.hh b/src/arch/alpha/tlb.hh index a4255f3c5..8df47dbec 100644 --- a/src/arch/alpha/tlb.hh +++ b/src/arch/alpha/tlb.hh @@ -48,20 +48,20 @@ class ThreadContext; namespace AlphaISA { - class PTE; + class TlbEntry; class TLB : public SimObject { protected: typedef std::multimap PageTable; - PageTable lookupTable; // Quick lookup into page table + PageTable lookupTable; // Quick lookup into page table - PTE *table; // the Page Table - int size; // TLB Size - int nlu; // not last used entry (for replacement) + TlbEntry *table; // the Page Table + int size; // TLB Size + int nlu; // not last used entry (for replacement) void nextnlu() { if (++nlu >= size) nlu = 0; } - PTE *lookup(Addr vpn, uint8_t asn); + TlbEntry *lookup(Addr vpn, uint8_t asn); public: TLB(const std::string &name, int size); @@ -69,8 +69,8 @@ namespace AlphaISA int getsize() const { return size; } - PTE &index(bool advance = true); - void insert(Addr vaddr, PTE &pte); + TlbEntry &index(bool advance = true); + void insert(Addr vaddr, TlbEntry &entry); void flushAll(); void flushProcesses(); @@ -90,13 +90,17 @@ namespace AlphaISA virtual void unserialize(Checkpoint *cp, const std::string §ion); // Most recently used page table entries - PTE *PTECache[3]; - inline void flushCache() { memset(PTECache, 0, 3 * sizeof(PTE*)); } - inline PTE* updateCache(PTE *pte) { - PTECache[2] = PTECache[1]; - PTECache[1] = PTECache[0]; - PTECache[0] = pte; - return pte; + TlbEntry *EntryCache[3]; + inline void flushCache() + { + memset(EntryCache, 0, 3 * sizeof(TlbEntry*)); + } + + inline TlbEntry* updateCache(TlbEntry *entry) { + EntryCache[2] = EntryCache[1]; + EntryCache[1] = EntryCache[0]; + EntryCache[0] = entry; + return entry; } }; -- cgit v1.2.3