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 (cr0.pe) { 567 DPRINTF(TLB, "In protected mode.\n"); 568 Efer efer = tc->readMiscRegNoEffect(MISCREG_EFER); 569 SegAttr csAttr = tc->readMiscRegNoEffect(MISCREG_CS_ATTR); 570 // If we're not in 64-bit mode, do protection/limit checks 571 if (!efer.lma || !csAttr.longMode) { 572 DPRINTF(TLB, "Not in long mode. Checking segment protection.\n"); 573 // Check for a NULL segment selector. |
574 if (!(seg == SEGMENT_REG_TSG || seg == SYS_SEGMENT_REG_IDTR || 575 seg == SEGMENT_REG_HS || seg == SEGMENT_REG_LS || 576 seg == SEGMENT_REG_MS) 577 && !tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg))) |
578 return new GeneralProtection(0); 579 bool expandDown = false; 580 SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg)); 581 if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) { 582 if (!attr.writable && mode == Write) 583 return new GeneralProtection(0); 584 if (!attr.readable && mode == Read) 585 return new GeneralProtection(0); --- 168 unchanged lines hidden --- |