tlb.cc (9025:545591665fc7) | tlb.cc (9028:f92783bcfd25) |
---|---|
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 --- 255 unchanged lines hidden (view full) --- 264 return new GeneralProtection(0); 265 if (!attr.readable && mode == Read) 266 return new GeneralProtection(0); 267 expandDown = attr.expandDown; 268 269 } 270 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg)); 271 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg)); | 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 --- 255 unchanged lines hidden (view full) --- 264 return new GeneralProtection(0); 265 if (!attr.readable && mode == Read) 266 return new GeneralProtection(0); 267 expandDown = attr.expandDown; 268 269 } 270 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg)); 271 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg)); |
272 // This assumes we're not in 64 bit mode. If we were, the default 273 // address size is 64 bits, overridable to 32. 274 int size = 32; | |
275 bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift)); | 272 bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift)); |
276 SegAttr csAttr = tc->readMiscRegNoEffect(MISCREG_CS_ATTR); 277 if ((csAttr.defaultSize && sizeOverride) || 278 (!csAttr.defaultSize && !sizeOverride)) 279 size = 16; 280 Addr offset = bits(vaddr - base, size-1, 0); | 273 int logSize = sizeOverride ? m5Reg.altAddr : m5Reg.defAddr; 274 int size = (1 << logSize) * 8; 275 Addr offset = bits(vaddr - base, size - 1, 0); |
281 Addr endOffset = offset + req->getSize() - 1; 282 if (expandDown) { 283 DPRINTF(TLB, "Checking an expand down segment.\n"); 284 warn_once("Expand down segments are untested.\n"); 285 if (offset <= limit || endOffset <= limit) 286 return new GeneralProtection(0); 287 } else { 288 if (offset > limit || endOffset > limit) --- 166 unchanged lines hidden --- | 276 Addr endOffset = offset + req->getSize() - 1; 277 if (expandDown) { 278 DPRINTF(TLB, "Checking an expand down segment.\n"); 279 warn_once("Expand down segments are untested.\n"); 280 if (offset <= limit || endOffset <= limit) 281 return new GeneralProtection(0); 282 } else { 283 if (offset > limit || endOffset > limit) --- 166 unchanged lines hidden --- |