1/* 2 * Copyright (c) 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 * --- 201 unchanged lines hidden (view full) --- 210X86ISA::Interrupts::read(PacketPtr pkt) 211{ 212 Addr offset = pkt->getAddr() - pioAddr; 213 //Make sure we're at least only accessing one register. 214 if ((offset & ~mask(3)) != ((offset + pkt->getSize()) & ~mask(3))) 215 panic("Accessed more than one register at a time in the APIC!\n"); 216 ApicRegIndex reg = decodeAddr(offset); 217 uint32_t val = htog(readReg(reg)); |
218 DPRINTF(LocalApic, 219 "Reading Local APIC register %d at offset %#x as %#x.\n", 220 reg, offset, val); |
221 pkt->setData(((uint8_t *)&val) + (offset & mask(3))); 222 return latency; 223} 224 225Tick 226X86ISA::Interrupts::write(PacketPtr pkt) 227{ 228 Addr offset = pkt->getAddr() - pioAddr; 229 //Make sure we're at least only accessing one register. 230 if ((offset & ~mask(3)) != ((offset + pkt->getSize()) & ~mask(3))) 231 panic("Accessed more than one register at a time in the APIC!\n"); 232 ApicRegIndex reg = decodeAddr(offset); 233 uint32_t val = regs[reg]; 234 pkt->writeData(((uint8_t *)&val) + (offset & mask(3))); |
235 DPRINTF(LocalApic, 236 "Writing Local APIC register %d at offset %#x as %#x.\n", 237 reg, offset, gtoh(val)); |
238 setReg(reg, gtoh(val)); 239 return latency; 240} 241 242uint32_t 243X86ISA::Interrupts::readReg(ApicRegIndex reg) 244{ 245 if (reg >= APIC_TRIGGER_MODE(0) && --- 155 unchanged lines hidden --- |