The Pedigree Project
0.1
|
#include <OpenPic.h>
Classes | |
struct | Feature |
Public Member Functions | |
virtual irq_id_t | registerIsaIrqHandler (uint8_t irq, IrqHandler *handler) |
virtual irq_id_t | registerPciIrqHandler (IrqHandler *handler) |
virtual void | acknowledgeIrq (irq_id_t Id) |
virtual void | unregisterHandler (irq_id_t Id, IrqHandler *handler) |
bool | initialise () INITIALISATION_ONLY |
Public Member Functions inherited from IrqManager | |
virtual irq_id_t | registerIsaIrqHandler (uint8_t irq, IrqHandler *handler, bool bEdge=false)=0 |
virtual irq_id_t | registerPciIrqHandler (IrqHandler *handler, Device *pDevice)=0 |
virtual void | tick () |
virtual bool | control (uint8_t irq, ControlCode code, size_t argument) |
Static Public Member Functions | |
static OpenPic & | instance () |
Private Member Functions | |
OpenPic () INITIALISATION_ONLY | |
virtual | ~OpenPic () |
OpenPic (const OpenPic &) | |
OpenPic & | operator= (const OpenPic &) |
void | searchNode (class Device *pDev) |
virtual void | interrupt (size_t interruptNumber, InterruptState &state) |
void | eoi (uint8_t irq) |
void | enable (uint8_t irq, bool enable) |
void | enableAll (bool enable) |
virtual | ~InterruptHandler () |
Private Attributes | |
IoBase * | m_pPort |
IrqHandler * | m_Handler [64] |
size_t | m_nIrqs |
Static Private Attributes | |
static OpenPic | m_Instance |
Additional Inherited Members | |
Public Types inherited from IrqManager | |
enum | ControlCode { MitigationThreshold } |
Protected Member Functions inherited from IrqManager | |
IrqManager () | |
virtual | ~IrqManager () |
The PPC's programmable interrupt controller as IrqManager
|
private |
The default constructor
Definition at line 166 of file OpenPic.cc.
References m_Handler.
Referenced by instance(), and ~OpenPic().
|
inlineprivatevirtual |
The destructor
Definition at line 83 of file OpenPic.h.
References interrupt(), OpenPic(), and operator=().
|
private |
The copy-constructor
|
virtual |
Acknoledge the IRQ reception, in case you returned false in the IrqHandler::irq() function. If this is not called there won't be any following irqs.
[in] | Id | the irq's identifier |
Implements IrqManager.
Definition at line 49 of file OpenPic.cc.
Referenced by instance().
bool OpenPic::initialise | ( | ) |
Initialises the PIC hardware and registers the interrupts with the InterruptManager.
Definition at line 105 of file OpenPic.cc.
References ERROR, Hex, InterruptManager::instance(), m_nIrqs, m_pPort, IoBase::read32(), InterruptManager::registerInterruptHandler(), Device::root(), and IoBase::write32().
Referenced by instance().
|
inlinestatic |
Get the Pic class instance
Definition at line 61 of file OpenPic.h.
References acknowledgeIrq(), INITIALISATION_ONLY, initialise(), m_Instance, OpenPic(), and unregisterHandler().
Referenced by Mac::initialiseDeviceTree().
|
privatevirtual |
Called when the handler is registered with the interrupt manager and the interrupt occurred
[in] | nInterruptNumber | the interrupt number |
[in] | state | reference to the state before the interrupt |
Implements InterruptHandler.
Definition at line 172 of file OpenPic.cc.
References Debugger::instance(), LIKELY, m_Handler, m_nIrqs, m_pPort, NOTICE, IoBase::read32(), Debugger::start(), and IoBase::write32().
Referenced by ~OpenPic().
The assignment operator
Referenced by ~OpenPic().
|
virtual |
Unregister a previously registered IrqHandler
[in] | Id | the irq's identifier |
Implements IrqManager.
Definition at line 57 of file OpenPic.cc.
References Device::addresses(), Device::getChild(), Device::getNumChildren(), m_Handler, and m_pPort.
Referenced by instance().
|
private |
The IRQ handler
Definition at line 108 of file OpenPic.h.
Referenced by interrupt(), OpenPic(), and unregisterHandler().
|
staticprivate |
|
private |
The number of IRQs available
Definition at line 111 of file OpenPic.h.
Referenced by initialise(), and interrupt().
|
private |
The PIC I/O Port range
Definition at line 105 of file OpenPic.h.
Referenced by initialise(), interrupt(), and unregisterHandler().