20 #include "Decrementer.h" 21 #include "../core/processor/ppc32/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/machine/openfirmware/Device.h" 26 #include "pedigree/kernel/machine/openfirmware/OpenFirmware.h" 27 #include "pedigree/kernel/processor/InterruptManager.h" 28 #include "pedigree/kernel/processor/Processor.h" 49 OFDevice cpu(chosen.getProperty(
"cpu"));
51 reinterpret_cast<uint32_t
>(cpu.getProperty(
"timebase-frequency"));
52 if (static_cast<int32_t>(m_Frequency) <= 0)
54 WARNING(
"Cpu::timebase-frequency property not available!");
55 m_Frequency = 0x100000;
59 uint32_t n = (DECREMENTER_PERIOD *
m_Frequency) / 1000;
60 asm volatile(
"mtdec %0" : :
"r"(n));
72 uint32_t numFired = 0;
77 uint32_t n = (DECREMENTER_PERIOD *
m_Frequency) / 1000;
78 asm volatile(
"mtdec %0" : :
"r"(n));
static OpenFirmware & instance()
Decrementer() INITIALISATION_ONLY
static Decrementer m_Instance
virtual void timer(uint64_t delta, InterruptState &state)=0
bool initialise() INITIALISATION_ONLY
static InterruptManager & instance()
virtual void interrupt(size_t interruptNumber, InterruptState &state)