tlb.cc (5419:a06807c228c1) tlb.cc (5431:914851b44a74)
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 *

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

566 // If protected mode has been enabled...
567 if (cr0.pe) {
568 DPRINTF(TLB, "In protected mode.\n");
569 Efer efer = tc->readMiscRegNoEffect(MISCREG_EFER);
570 SegAttr csAttr = tc->readMiscRegNoEffect(MISCREG_CS_ATTR);
571 // If we're not in 64-bit mode, do protection/limit checks
572 if (!efer.lma || !csAttr.longMode) {
573 DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
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 *

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

566 // If protected mode has been enabled...
567 if (cr0.pe) {
568 DPRINTF(TLB, "In protected mode.\n");
569 Efer efer = tc->readMiscRegNoEffect(MISCREG_EFER);
570 SegAttr csAttr = tc->readMiscRegNoEffect(MISCREG_CS_ATTR);
571 // If we're not in 64-bit mode, do protection/limit checks
572 if (!efer.lma || !csAttr.longMode) {
573 DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
574 // Check for a NULL segment selector.
575 if (!tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
576 return new GeneralProtection(0);
574 SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
575 if (!attr.writable && write)
576 return new GeneralProtection(0);
577 if (!attr.readable && !write && !execute)
578 return new GeneralProtection(0);
579 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg));
580 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg));
581 if (!attr.expandDown) {

--- 270 unchanged lines hidden ---
577 SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
578 if (!attr.writable && write)
579 return new GeneralProtection(0);
580 if (!attr.readable && !write && !execute)
581 return new GeneralProtection(0);
582 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg));
583 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg));
584 if (!attr.expandDown) {

--- 270 unchanged lines hidden ---