20 #include "IrqManager.h" 21 #include "pedigree/kernel/LockGuard.h" 22 #include "pedigree/kernel/Log.h" 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/debugger/Debugger.h" 33 static int irqToSignal[2] = {0};
34 static int signalToIrq[NSIG] = {0};
56 m_Handler[irq].pushBack(handler);
58 return irqToSignal[irq];
71 m_Handler[irq].pushBack(handler);
73 return irqToSignal[irq];
82 size_t irq = signalToIrq[Id];
86 it != m_Handler[irq].
end(); it++)
90 m_Handler[irq].erase(it);
105 irqToSignal[0] = SIGUSR1;
106 irqToSignal[1] = SIGUSR2;
108 signalToIrq[SIGUSR1] = 0;
109 signalToIrq[SIGUSR2] = 1;
116 for (
size_t i = 0; i < 2; i++)
124 size_t irq = signalToIrq[interruptNumber];
132 (*it)->irq(irq, state);
137 NOTICE(
"HostedIrqManager: unhandled irq #" << irq <<
" occurred");
virtual bool registerInterruptHandler(size_t nInterruptNumber, InterruptHandler *pHandler)=0
HostedIrqManager() INITIALISATION_ONLY
Handles interrupts and interrupt registrations from kernel components.
static HostedIrqManager m_Instance
virtual irq_id_t registerPciIrqHandler(IrqHandler *handler, Device *pDevice)
virtual uintptr_t getInterruptNumber()
virtual void interrupt(size_t interruptNumber, InterruptState &state)
bool initialise() INITIALISATION_ONLY
virtual void unregisterHandler(irq_id_t Id, IrqHandler *handler)
virtual bool control(uint8_t irq, ControlCode code, size_t argument)
List< IrqHandler * > m_Handler[2]
static InterruptManager & instance()
virtual void acknowledgeIrq(irq_id_t Id)
virtual irq_id_t registerIsaIrqHandler(uint8_t irq, IrqHandler *handler, bool bEdge=false)