tlb.cc (12406:86bde4a026b5) tlb.cc (12455:c88f0b37f433)
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

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

89
90 assert(tlb[lru].trieHandle);
91 trie.remove(tlb[lru].trieHandle);
92 tlb[lru].trieHandle = NULL;
93 freeList.push_back(&tlb[lru]);
94}
95
96TlbEntry *
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

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

89
90 assert(tlb[lru].trieHandle);
91 trie.remove(tlb[lru].trieHandle);
92 tlb[lru].trieHandle = NULL;
93 freeList.push_back(&tlb[lru]);
94}
95
96TlbEntry *
97TLB::insert(Addr vpn, TlbEntry &entry)
97TLB::insert(Addr vpn, const TlbEntry &entry)
98{
99 // If somebody beat us to it, just use that existing entry.
100 TlbEntry *newEntry = trie.lookup(vpn);
101 if (newEntry) {
102 assert(newEntry->vaddr == vpn);
103 return newEntry;
104 }
105

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

352 // This gets ignored in atomic mode.
353 delayedResponse = true;
354 return fault;
355 }
356 entry = lookup(vaddr);
357 assert(entry);
358 } else {
359 Process *p = tc->getProcessPtr();
98{
99 // If somebody beat us to it, just use that existing entry.
100 TlbEntry *newEntry = trie.lookup(vpn);
101 if (newEntry) {
102 assert(newEntry->vaddr == vpn);
103 return newEntry;
104 }
105

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

352 // This gets ignored in atomic mode.
353 delayedResponse = true;
354 return fault;
355 }
356 entry = lookup(vaddr);
357 assert(entry);
358 } else {
359 Process *p = tc->getProcessPtr();
360 TlbEntry newEntry;
361 bool success = p->pTable->lookup(vaddr, newEntry);
362 if (!success && mode != Execute) {
360 TlbEntry *newEntry = p->pTable->lookup(vaddr);
361 if (!newEntry && mode != Execute) {
363 // Check if we just need to grow the stack.
364 if (p->fixupStackFault(vaddr)) {
365 // If we did, lookup the entry for the new page.
362 // Check if we just need to grow the stack.
363 if (p->fixupStackFault(vaddr)) {
364 // If we did, lookup the entry for the new page.
366 success = p->pTable->lookup(vaddr, newEntry);
365 newEntry = p->pTable->lookup(vaddr);
367 }
368 }
366 }
367 }
369 if (!success) {
368 if (!newEntry) {
370 return std::make_shared<PageFault>(vaddr, true, mode,
371 true, false);
372 } else {
373 Addr alignedVaddr = p->pTable->pageAlign(vaddr);
374 DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
369 return std::make_shared<PageFault>(vaddr, true, mode,
370 true, false);
371 } else {
372 Addr alignedVaddr = p->pTable->pageAlign(vaddr);
373 DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
375 newEntry.pageStart());
376 entry = insert(alignedVaddr, newEntry);
374 newEntry->pageStart());
375 entry = insert(alignedVaddr, *newEntry);
377 }
378 DPRINTF(TLB, "Miss was serviced.\n");
379 }
380 }
381
382 DPRINTF(TLB, "Entry found with paddr %#x, "
383 "doing protection checks.\n", entry->paddr);
384 // Do paging protection checks.

--- 137 unchanged lines hidden ---
376 }
377 DPRINTF(TLB, "Miss was serviced.\n");
378 }
379 }
380
381 DPRINTF(TLB, "Entry found with paddr %#x, "
382 "doing protection checks.\n", entry->paddr);
383 // Do paging protection checks.

--- 137 unchanged lines hidden ---