tlb.cc (8535:d04ae08781e2) tlb.cc (8539:7d3ea3c65c66)
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

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

614 DPRINTF(TLB, "Handling a TLB miss for "
615 "address %#x at pc %#x.\n",
616 vaddr, tc->instAddr());
617
618 Process *p = tc->getProcessPtr();
619 TlbEntry newEntry;
620 bool success = p->pTable->lookup(vaddr, newEntry);
621 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

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

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

--- 124 unchanged lines hidden ---
627 }
628 if (!success) {
629 return new PageFault(vaddr, true, mode, true, false);
630 } else {
631 Addr alignedVaddr = p->pTable->pageAlign(vaddr);
632 DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
633 newEntry.pageStart());
634 entry = insert(alignedVaddr, newEntry);

--- 124 unchanged lines hidden ---