diff options
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/interrupts.cc | 8 | ||||
-rw-r--r-- | src/arch/x86/interrupts.hh | 22 |
2 files changed, 9 insertions, 21 deletions
diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index b869a929e..0ef79a472 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -588,7 +588,7 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val) X86ISA::Interrupts::Interrupts(Params * p) : BasicPioDevice(p, PageBytes), IntDevice(this, p->int_latency), - apicTimerEvent(this), + apicTimerEvent([this]{ processApicTimerEvent(); }, name()), pendingSmi(false), smiVector(0), pendingNmi(false), nmiVector(0), pendingExtInt(false), extIntVector(0), @@ -767,3 +767,9 @@ X86LocalApicParams::create() { return new X86ISA::Interrupts(this); } + +void +X86ISA::Interrupts::processApicTimerEvent() { + if (triggerTimerInterrupt()) + setReg(APIC_INITIAL_COUNT, readReg(APIC_INITIAL_COUNT)); +} diff --git a/src/arch/x86/interrupts.hh b/src/arch/x86/interrupts.hh index 26699b01e..bfd188961 100644 --- a/src/arch/x86/interrupts.hh +++ b/src/arch/x86/interrupts.hh @@ -92,26 +92,8 @@ class Interrupts : public BasicPioDevice, IntDevice /* * Timing related stuff. */ - class ApicTimerEvent : public Event - { - private: - Interrupts *localApic; - public: - ApicTimerEvent(Interrupts *_localApic) : - Event(), localApic(_localApic) - {} - - void process() - { - assert(localApic); - if (localApic->triggerTimerInterrupt()) { - localApic->setReg(APIC_INITIAL_COUNT, - localApic->readReg(APIC_INITIAL_COUNT)); - } - } - }; - - ApicTimerEvent apicTimerEvent; + EventFunctionWrapper apicTimerEvent; + void processApicTimerEvent(); /* * A set of variables to keep track of interrupts that don't go through |