tlb.cc (8953:488d45aeb672) tlb.cc (8962:397cbf4b11a6)
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 trie.remove(tlb[lru].trieHandle);
94 tlb[lru].trieHandle = NULL;
95 freeList.push_back(&tlb[lru]);
96}
97
98TlbEntry *
99TLB::insert(Addr vpn, TlbEntry &entry)
100{
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 trie.remove(tlb[lru].trieHandle);
94 tlb[lru].trieHandle = NULL;
95 freeList.push_back(&tlb[lru]);
96}
97
98TlbEntry *
99TLB::insert(Addr vpn, TlbEntry &entry)
100{
101 //TODO Deal with conflicting entries
101 // If somebody beat us to it, just use that existing entry.
102 TlbEntry *newEntry = trie.lookup(vpn);
103 if (newEntry) {
104 assert(newEntry->vaddr = vpn);
105 return newEntry;
106 }
102
107
103 TlbEntry *newEntry = NULL;
104 if (freeList.empty())
105 evictLRU();
108 if (freeList.empty())
109 evictLRU();
110
106 newEntry = freeList.front();
107 freeList.pop_front();
108
109 *newEntry = entry;
110 newEntry->lruSeq = nextSeq();
111 newEntry->vaddr = vpn;
112 newEntry->trieHandle =
111 newEntry = freeList.front();
112 freeList.pop_front();
113
114 *newEntry = entry;
115 newEntry->lruSeq = nextSeq();
116 newEntry->vaddr = vpn;
117 newEntry->trieHandle =
113 trie.insert(vpn, TlbEntryTrie::MaxBits - entry.logBytes, newEntry);
118 trie.insert(vpn, TlbEntryTrie::MaxBits - entry.logBytes, newEntry);
114 return newEntry;
115}
116
117TlbEntry *
118TLB::lookup(Addr va, bool update_lru)
119{
120 TlbEntry *entry = trie.lookup(va);
121 if (entry && update_lru)

--- 328 unchanged lines hidden ---
119 return newEntry;
120}
121
122TlbEntry *
123TLB::lookup(Addr va, bool update_lru)
124{
125 TlbEntry *entry = trie.lookup(va);
126 if (entry && update_lru)

--- 328 unchanged lines hidden ---