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

#include <IrqManager.h>

+ Inheritance diagram for HostedIrqManager:
+ Collaboration diagram for HostedIrqManager:

Public Member Functions

irq_id_t registerIsaIrqHandler (uint8_t irq, IrqHandler *handler, const IrqPolicy &policy) override
 
irq_id_t registerPciIrqHandler (IrqHandler *handler, class Device *device, const IrqPolicy &policy) override
 
irq_id_t registerHardIsaIrqHandler (uint8_t irq, HardIrqHandler *handler, const IrqPolicy &policy) override
 
irq_id_t registerHardPciIrqHandler (HardIrqHandler *handler, class Device *device, const IrqPolicy &policy) override
 
irq_id_t registerSchedulerIrqHandler (uint8_t irq, SchedulerIrqHandler *handler, const IrqPolicy &policy) override
 
bool unregisterSchedulerIrqHandler (irq_id_t id, SchedulerIrqHandler *handler) override
 
bool unregisterHandler (irq_id_t id, IrqHandlerBase *handler) override
 
bool initialise () INITIALISATION_ONLY
 
bool control (uint8_t irq, ControlCode code, size_t argument) override
 
void enable (uint8_t irq, bool enable) override
 
- Public Member Functions inherited from IrqManager
virtual irq_id_t registerPciMessageIrqHandler (IrqHandler *handler, Device *pDevice, const IrqPolicy &intxFallbackPolicy)
 
virtual bool registerPciMsixIrqHandlers (Device *device, IrqHandler *const *handlers, size_t count, irq_id_t *ids, bool &fallbackSafe, const size_t *processors=nullptr)
 
virtual irq_id_t registerHardPciMessageIrqHandler (HardIrqHandler *handler, Device *pDevice, const IrqPolicy &intxFallbackPolicy)
 
virtual size_t snapshotIrqLines (IrqLineDiagnosticSnapshot *out, size_t capacity) const
 
virtual void tick ()
 

Static Public Member Functions

static HostedIrqManager & instance ()
 

Private Member Functions

 HostedIrqManager (const HostedIrqManager &)=delete
 
HostedIrqManager & operator= (const HostedIrqManager &)=delete
 
void interrupt (size_t interruptNumber, InterruptState &state) override
 
virtual ~InterruptHandler ()
 

Private Attributes

HardIrqHandler * m_TimerHandler
 
SchedulerIrqHandler * m_SchedulerHandler
 

Static Private Attributes

static HostedIrqManager m_Instance
 

Additional Inherited Members

- Public Types inherited from IrqManager
enum  ControlCode { MitigationThreshold }
 
- Protected Member Functions inherited from IrqManager
 IrqManager ()
 
virtual ~IrqManager ()
 

Detailed Description

Routes the two synthetic signals used by the hosted machine.

Hosted is a single-processor kernel validation shim, not an interrupt controller model. Line 0 belongs exclusively to the hosted wall-clock timer and line 1 belongs exclusively to the scheduler timer. Device, PCI, shared, and threaded controller registrations are deliberately unsupported.

Definition at line 36 of file kernel/machine/hosted/IrqManager.h.

Constructor & Destructor Documentation

◆ HostedIrqManager()

HostedIrqManager::HostedIrqManager ( )
private

Definition at line 123 of file hosted/IrqManager.cc.

◆ ~HostedIrqManager()

HostedIrqManager::~HostedIrqManager ( )
inlineoverrideprivate

Definition at line 70 of file kernel/machine/hosted/IrqManager.h.

Member Function Documentation

◆ control()

bool HostedIrqManager::control ( uint8_t  irq,
ControlCode  code,
size_t  argument 
)
overridevirtual

Controls specific elements of a given IRQ

Reimplemented from IrqManager.

Definition at line 119 of file hosted/IrqManager.cc.

◆ enable()

void HostedIrqManager::enable ( uint8_t  irq,
bool  enable 
)
inlineoverridevirtual

Implements IrqManager.

Definition at line 59 of file kernel/machine/hosted/IrqManager.h.

◆ initialise()

bool HostedIrqManager::initialise ( )

Definition at line 113 of file hosted/IrqManager.cc.

◆ instance()

static HostedIrqManager & HostedIrqManager::instance ( )
inlinestatic

Definition at line 38 of file kernel/machine/hosted/IrqManager.h.

◆ interrupt()

void HostedIrqManager::interrupt ( size_t  nInterruptNumber,
InterruptState &  state 
)
overrideprivatevirtual

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 125 of file hosted/IrqManager.cc.

References HardIrqHandler::irq().

◆ registerHardIsaIrqHandler()

irq_id_t HostedIrqManager::registerHardIsaIrqHandler ( uint8_t  irq,
HardIrqHandler *  handler,
const IrqPolicy &  policy 
)
overridevirtual

Register an ISA handler which must run in hard IRQ context.

Implements IrqManager.

Definition at line 56 of file hosted/IrqManager.cc.

◆ registerHardPciIrqHandler()

irq_id_t HostedIrqManager::registerHardPciIrqHandler ( HardIrqHandler *  handler,
class Device *  pDevice,
const IrqPolicy &  policy 
)
overridevirtual

Register a PCI handler which must run in hard IRQ context.

Implements IrqManager.

Definition at line 70 of file hosted/IrqManager.cc.

◆ registerIsaIrqHandler()

irq_id_t HostedIrqManager::registerIsaIrqHandler ( uint8_t  irq,
IrqHandler *  handler,
const IrqPolicy &  policy 
)
overridevirtual

Register an ISA irq

Parameters
[in]irqthe ISA irq number (from 0 to 15)
[in]handlerpointer to the IrqHandler class
[in]policyelectrical, acknowledgement, and completion policy
Returns
the irq's identifier

Implements IrqManager.

Definition at line 48 of file hosted/IrqManager.cc.

◆ registerPciIrqHandler()

irq_id_t HostedIrqManager::registerPciIrqHandler ( IrqHandler *  handler,
class Device *  pDevice,
const IrqPolicy &  policy 
)
overridevirtual

Register a PCI irq

Implements IrqManager.

Definition at line 52 of file hosted/IrqManager.cc.

◆ registerSchedulerIrqHandler()

irq_id_t HostedIrqManager::registerSchedulerIrqHandler ( uint8_t  irq,
SchedulerIrqHandler *  handler,
const IrqPolicy &  policy 
)
overridevirtual

Install the platform's dedicated scheduler-timer interrupt source.

Unlike a generic hard handler, this callback is the terminal action for an occurrence and is allowed to abandon its interrupt frame. Platforms which do not provide a direct scheduler route reject the request.

Reimplemented from IrqManager.

Definition at line 74 of file hosted/IrqManager.cc.

◆ unregisterHandler()

bool HostedIrqManager::unregisterHandler ( irq_id_t  Id,
IrqHandlerBase *  handler 
)
overridevirtual

Unregister a previously registered IrqHandler.

A successful return is an ownership barrier: no callback can begin or remain active for the handler. A callback cannot synchronously remove itself, and an atomic context cannot wait for an active callback; those requests return false.

Parameters
[in]Idthe irq's identifier
Returns
true if removal completed synchronously

Implements IrqManager.

Definition at line 99 of file hosted/IrqManager.cc.

◆ unregisterSchedulerIrqHandler()

bool HostedIrqManager::unregisterSchedulerIrqHandler ( irq_id_t  Id,
SchedulerIrqHandler *  handler 
)
overridevirtual

Stop admitting future callbacks for the exact scheduler source. The source must be quiesced first unless removal synchronously masks its controller line. Its handler has static machine lifetime because an already-admitted callback may not return.

Reimplemented from IrqManager.

Definition at line 88 of file hosted/IrqManager.cc.

Member Data Documentation

◆ m_Instance

HostedIrqManager HostedIrqManager::m_Instance
staticprivate

Definition at line 80 of file kernel/machine/hosted/IrqManager.h.

◆ m_SchedulerHandler

SchedulerIrqHandler* HostedIrqManager::m_SchedulerHandler
private

Definition at line 78 of file kernel/machine/hosted/IrqManager.h.

◆ m_TimerHandler

HardIrqHandler* HostedIrqManager::m_TimerHandler
private

Definition at line 77 of file kernel/machine/hosted/IrqManager.h.


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