tlb.cc (12749:223c83ed9979) | tlb.cc (13613:a19963be12ca) |
---|---|
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 --- 171 unchanged lines hidden (view full) --- 180 } else if (prefix == IntAddrPrefixMSR) { 181 vaddr = (vaddr >> 3) & ~IntAddrPrefixMask; 182 req->setFlags(Request::MMAPPED_IPR); 183 184 MiscRegIndex regNum; 185 if (!msrAddrToIndex(regNum, vaddr)) 186 return std::make_shared<GeneralProtection>(0); 187 | 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 --- 171 unchanged lines hidden (view full) --- 180 } else if (prefix == IntAddrPrefixMSR) { 181 vaddr = (vaddr >> 3) & ~IntAddrPrefixMask; 182 req->setFlags(Request::MMAPPED_IPR); 183 184 MiscRegIndex regNum; 185 if (!msrAddrToIndex(regNum, vaddr)) 186 return std::make_shared<GeneralProtection>(0); 187 |
188 //The index is multiplied by the size of a MiscReg so that | 188 //The index is multiplied by the size of a RegVal so that |
189 //any memory dependence calculations will not see these as 190 //overlapping. | 189 //any memory dependence calculations will not see these as 190 //overlapping. |
191 req->setPaddr((Addr)regNum * sizeof(MiscReg)); | 191 req->setPaddr((Addr)regNum * sizeof(RegVal)); |
192 return NoFault; 193 } else if (prefix == IntAddrPrefixIO) { 194 // TODO If CPL > IOPL or in virtual mode, check the I/O permission 195 // bitmap in the TSS. 196 197 Addr IOPort = vaddr & ~IntAddrPrefixMask; 198 // Make sure the address fits in the expected 16 bit IO address 199 // space. 200 assert(!(IOPort & ~0xFFFF)); 201 if (IOPort == 0xCF8 && req->getSize() == 4) { 202 req->setFlags(Request::MMAPPED_IPR); | 192 return NoFault; 193 } else if (prefix == IntAddrPrefixIO) { 194 // TODO If CPL > IOPL or in virtual mode, check the I/O permission 195 // bitmap in the TSS. 196 197 Addr IOPort = vaddr & ~IntAddrPrefixMask; 198 // Make sure the address fits in the expected 16 bit IO address 199 // space. 200 assert(!(IOPort & ~0xFFFF)); 201 if (IOPort == 0xCF8 && req->getSize() == 4) { 202 req->setFlags(Request::MMAPPED_IPR); |
203 req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(MiscReg)); | 203 req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(RegVal)); |
204 } else if ((IOPort & ~mask(2)) == 0xCFC) { 205 req->setFlags(Request::UNCACHEABLE | Request::STRICT_ORDER); 206 Addr configAddress = 207 tc->readMiscRegNoEffect(MISCREG_PCI_CONFIG_ADDRESS); 208 if (bits(configAddress, 31, 31)) { 209 req->setPaddr(PhysAddrPrefixPciConfig | 210 mbits(configAddress, 30, 2) | 211 (IOPort & mask(2))); --- 315 unchanged lines hidden --- | 204 } else if ((IOPort & ~mask(2)) == 0xCFC) { 205 req->setFlags(Request::UNCACHEABLE | Request::STRICT_ORDER); 206 Addr configAddress = 207 tc->readMiscRegNoEffect(MISCREG_PCI_CONFIG_ADDRESS); 208 if (bits(configAddress, 31, 31)) { 209 req->setPaddr(PhysAddrPrefixPciConfig | 210 mbits(configAddress, 30, 2) | 211 (IOPort & mask(2))); --- 315 unchanged lines hidden --- |