21 #include "../core/processor/mips32/InterruptManager.h" 22 #include "pedigree/kernel/Log.h" 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/machine/Machine.h" 25 #include "pedigree/kernel/processor/InterruptManager.h" 26 #include "pedigree/kernel/processor/Processor.h" 30 bool CountCompareTimer::registerHandler(
TimerHandler *handler)
44 if (IntManager.registerExternalInterruptHandler(7,
this) ==
false)
50 asm volatile(
"mfc0 %0, $12, 1" :
"=r"(bleh));
55 asm volatile(
"mfc0 %0, $12;nop" :
"=r"(sr));
60 asm volatile(
"mtc0 %0, $12;nop" : :
"r"(sr));
63 asm volatile(
"mtc0 %0, $11; nop" : :
"r"(m_Compare));
65 asm volatile(
"mtc0 $zero, $9; nop");
81 asm volatile(
"mtc0 %0, $11; nop" : :
"r"(m_Compare));
87 asm volatile(
"mfc0 %0, $9; nop" :
"=r"(count));
89 if (count > m_Compare)
91 asm volatile(
"mtc0 %0, $9; nop" : :
"r"(m_Compare - 0x10000));
virtual void interrupt(size_t interruptNumber, InterruptState &state)
static CountCompareTimer m_Instance
virtual void timer(uint64_t delta, InterruptState &state)=0
static void setInterrupts(bool bEnable)
bool initialise() INITIALISATION_ONLY
CountCompareTimer() INITIALISATION_ONLY
static InterruptManager & instance()