The Pedigree Project  0.1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
OpenPic Class Reference

#include <OpenPic.h>

+ Inheritance diagram for OpenPic:
+ Collaboration diagram for OpenPic:

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 OpenPicinstance ()
 

Private Member Functions

 OpenPic () INITIALISATION_ONLY
 
virtual ~OpenPic ()
 
 OpenPic (const OpenPic &)
 
OpenPicoperator= (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

IoBasem_pPort
 
IrqHandlerm_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 ()
 

Detailed Description

The PPC's programmable interrupt controller as IrqManager

Definition at line 56 of file OpenPic.h.

Constructor & Destructor Documentation

OpenPic::OpenPic ( )
private

The default constructor

Definition at line 166 of file OpenPic.cc.

References m_Handler.

Referenced by instance(), and ~OpenPic().

+ Here is the caller graph for this function:

virtual OpenPic::~OpenPic ( )
inlineprivatevirtual

The destructor

Definition at line 83 of file OpenPic.h.

References interrupt(), OpenPic(), and operator=().

OpenPic::OpenPic ( const OpenPic )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

void OpenPic::acknowledgeIrq ( irq_id_t  Id)
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.

Parameters
[in]Idthe irq's identifier

Implements IrqManager.

Definition at line 49 of file OpenPic.cc.

Referenced by instance().

+ Here is the caller graph for this function:

bool OpenPic::initialise ( )

Initialises the PIC hardware and registers the interrupts with the InterruptManager.

Returns
true, if successfull, false otherwise
Todo:
Set up timers.

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().

+ Here is the caller graph for this function:

static OpenPic& OpenPic::instance ( )
inlinestatic

Get the Pic class instance

Returns
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().

+ Here is the caller graph for this function:

void OpenPic::interrupt ( size_t  nInterruptNumber,
InterruptState &  state 
)
privatevirtual

Called when the handler is registered with the interrupt manager and the interrupt occurred

Parameters
[in]nInterruptNumberthe interrupt number
[in]statereference 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().

+ Here is the caller graph for this function:

OpenPic& OpenPic::operator= ( const OpenPic )
private

The assignment operator

Note
NOT implemented

Referenced by ~OpenPic().

+ Here is the caller graph for this function:

void OpenPic::unregisterHandler ( irq_id_t  Id,
IrqHandler handler 
)
virtual

Unregister a previously registered IrqHandler

Parameters
[in]Idthe 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().

+ Here is the caller graph for this function:

Member Data Documentation

IrqHandler* OpenPic::m_Handler[64]
private

The IRQ handler

Definition at line 108 of file OpenPic.h.

Referenced by interrupt(), OpenPic(), and unregisterHandler().

OpenPic OpenPic::m_Instance
staticprivate

The Pic instance

Definition at line 114 of file OpenPic.h.

Referenced by instance().

size_t OpenPic::m_nIrqs
private

The number of IRQs available

Definition at line 111 of file OpenPic.h.

Referenced by initialise(), and interrupt().

IoBase* OpenPic::m_pPort
private

The PIC I/O Port range

Definition at line 105 of file OpenPic.h.

Referenced by initialise(), interrupt(), and unregisterHandler().


The documentation for this class was generated from the following files: