tlb.cc (5965:71f8d7c12619) tlb.cc (5980:0ea37baabfb0)
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

585
586 }
587 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg));
588 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg));
589 // This assumes we're not in 64 bit mode. If we were, the default
590 // address size is 64 bits, overridable to 32.
591 int size = 32;
592 bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift));
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

585
586 }
587 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg));
588 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg));
589 // This assumes we're not in 64 bit mode. If we were, the default
590 // address size is 64 bits, overridable to 32.
591 int size = 32;
592 bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift));
593 if (csAttr.defaultSize && sizeOverride ||
594 !csAttr.defaultSize && !sizeOverride)
593 if ((csAttr.defaultSize && sizeOverride) ||
594 (!csAttr.defaultSize && !sizeOverride))
595 size = 16;
596 Addr offset = bits(vaddr - base, size-1, 0);
597 Addr endOffset = offset + req->getSize() - 1;
598 if (expandDown) {
599 DPRINTF(TLB, "Checking an expand down segment.\n");
600 warn_once("Expand down segments are untested.\n");
601 if (offset <= limit || endOffset <= limit)
602 return new GeneralProtection(0);

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

642 entry = insert(alignedVaddr, newEntry);
643 }
644 DPRINTF(TLB, "Miss was serviced.\n");
645#endif
646 }
647 // Do paging protection checks.
648 bool inUser = (csAttr.dpl == 3 &&
649 !(flags & (CPL0FlagBit << FlagShift)));
595 size = 16;
596 Addr offset = bits(vaddr - base, size-1, 0);
597 Addr endOffset = offset + req->getSize() - 1;
598 if (expandDown) {
599 DPRINTF(TLB, "Checking an expand down segment.\n");
600 warn_once("Expand down segments are untested.\n");
601 if (offset <= limit || endOffset <= limit)
602 return new GeneralProtection(0);

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

642 entry = insert(alignedVaddr, newEntry);
643 }
644 DPRINTF(TLB, "Miss was serviced.\n");
645#endif
646 }
647 // Do paging protection checks.
648 bool inUser = (csAttr.dpl == 3 &&
649 !(flags & (CPL0FlagBit << FlagShift)));
650 if (inUser && !entry->user ||
651 write && !entry->writable) {
650 if ((inUser && !entry->user) ||
651 (write && !entry->writable)) {
652 // The page must have been present to get into the TLB in
653 // the first place. We'll assume the reserved bits are
654 // fine even though we're not checking them.
655 return new PageFault(vaddr, true, write,
656 inUser, false, execute);
657 }
658
659

--- 133 unchanged lines hidden ---
652 // The page must have been present to get into the TLB in
653 // the first place. We'll assume the reserved bits are
654 // fine even though we're not checking them.
655 return new PageFault(vaddr, true, write,
656 inUser, false, execute);
657 }
658
659

--- 133 unchanged lines hidden ---