diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2008-10-12 11:08:00 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2008-10-12 11:08:00 -0700 |
commit | 42ebebf99a7d6ce2358b152f643b52c7946f9202 (patch) | |
tree | 2255b51553c45c650a94950b1654cdec917ff339 /src/arch/x86/interrupts.hh | |
parent | d9f9c967fbe651e09d444e460a9b1c5a450b1cd2 (diff) | |
download | gem5-42ebebf99a7d6ce2358b152f643b52c7946f9202.tar.xz |
X86: Make the local APIC accessible through the memory system directly, and make the timer work.
Diffstat (limited to 'src/arch/x86/interrupts.hh')
-rw-r--r-- | src/arch/x86/interrupts.hh | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/arch/x86/interrupts.hh b/src/arch/x86/interrupts.hh index 68bb2e07d..1d5f600bd 100644 --- a/src/arch/x86/interrupts.hh +++ b/src/arch/x86/interrupts.hh @@ -61,6 +61,7 @@ #include "arch/x86/apicregs.hh" #include "arch/x86/faults.hh" #include "cpu/thread_context.hh" +#include "dev/io_device.hh" #include "params/X86LocalApic.hh" #include "sim/eventq.hh" #include "sim/sim_object.hh" @@ -70,10 +71,12 @@ class ThreadContext; namespace X86ISA { -class Interrupts : public SimObject +class Interrupts : public BasicPioDevice { protected: uint32_t regs[NUM_APIC_REGS]; + Tick latency; + Tick clock; class ApicTimerEvent : public Event { @@ -92,20 +95,38 @@ class Interrupts : public SimObject public: typedef X86LocalApicParams Params; + void setClock(Tick newClock) + { + clock = newClock; + } + const Params * params() const { return dynamic_cast<const Params *>(_params); } - uint32_t readRegNoEffect(ApicRegIndex reg); - uint32_t readReg(ApicRegIndex miscReg, ThreadContext *tc); + Tick read(PacketPtr pkt); + Tick write(PacketPtr pkt); + + void addressRanges(AddrRangeList &range_list) + { + range_list.clear(); + range_list.push_back(RangeEx(x86LocalAPICAddress(0, 0), + x86LocalAPICAddress(0, 0) + PageBytes)); + } - void setRegNoEffect(ApicRegIndex reg, uint32_t val); - void setReg(ApicRegIndex reg, uint32_t val, ThreadContext *tc); + uint32_t readReg(ApicRegIndex miscReg); + void setReg(ApicRegIndex reg, uint32_t val); + void setRegNoEffect(ApicRegIndex reg, uint32_t val) + { + regs[reg] = val; + } - Interrupts(Params * p) : SimObject(p) + Interrupts(Params * p) : BasicPioDevice(p), + latency(p->pio_latency), clock(0) { + pioSize = PageBytes; //Set the local apic DFR to the flat model. regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1); memset(regs, 0, sizeof(regs)); |