tlb.cc (8232:b28d06a175be) | tlb.cc (8534:09745e0c3dd9) |
---|---|
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 --- 604 unchanged lines hidden (view full) --- 613 DPRINTF(TLB, "Handling a TLB miss for " 614 "address %#x at pc %#x.\n", 615 vaddr, tc->instAddr()); 616 617 Process *p = tc->getProcessPtr(); 618 TlbEntry newEntry; 619 bool success = p->pTable->lookup(vaddr, newEntry); 620 if (!success && mode != Execute) { | 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 --- 604 unchanged lines hidden (view full) --- 613 DPRINTF(TLB, "Handling a TLB miss for " 614 "address %#x at pc %#x.\n", 615 vaddr, tc->instAddr()); 616 617 Process *p = tc->getProcessPtr(); 618 TlbEntry newEntry; 619 bool success = p->pTable->lookup(vaddr, newEntry); 620 if (!success && mode != Execute) { |
621 p->checkAndAllocNextPage(vaddr); 622 success = p->pTable->lookup(vaddr, newEntry); | 621 // This may fail because for some reason the requested 622 // address is not allocatable on the stack. If it's a stack 623 // address, then it's because the address fell outside of 624 // max stack range and user should increase max size of 625 // stack. Otherwise, it could be a random address that was 626 // not in the page table and not on the stack. Either way, 627 // you'll end up with a page fault. 628 if (p->checkAndAllocNextPage(vaddr)) 629 // Might as well not check this if you failed to 630 // allocate. Partially nested this just so code 631 // maintainers can understand this is a separate and 632 // necessary step not sufficient just by reading return 633 // value of checkAndAlloc call because there is a side 634 // effect. This call will populate (it's called by 635 // reference). 636 success = p->pTable->lookup(vaddr, newEntry); |
623 } 624 if (!success) { 625 return new PageFault(vaddr, true, mode, true, false); 626 } else { 627 Addr alignedVaddr = p->pTable->pageAlign(vaddr); 628 DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr, 629 newEntry.pageStart()); 630 entry = insert(alignedVaddr, newEntry); --- 124 unchanged lines hidden --- | 637 } 638 if (!success) { 639 return new PageFault(vaddr, true, mode, true, false); 640 } else { 641 Addr alignedVaddr = p->pTable->pageAlign(vaddr); 642 DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr, 643 newEntry.pageStart()); 644 entry = insert(alignedVaddr, newEntry); --- 124 unchanged lines hidden --- |