FreeNOS
Public Types | Public Member Functions | Protected Attributes
IntController Class Referenceabstract

Interrupt controller interface. More...

#include <IntController.h>

Inheritance diagram for IntController:
ARMGenericInterrupt BroadcomInterrupt IntelAPIC IntelPIC

Public Types

enum  Result {
  Success, InvalidIRQ, InvalidFrequency, IOError,
  NotFound
}
 Result codes. More...
 

Public Member Functions

 IntController ()
 Constructor. More...
 
uint getBase () const
 Get interrupt number base offset. More...
 
virtual Result enable (uint irq)=0
 Enable hardware interrupt (IRQ). More...
 
virtual Result disable (uint irq)=0
 Disable hardware interrupt (IRQ). More...
 
virtual Result clear (uint irq)=0
 Clear hardware interrupt (IRQ). More...
 
virtual Result nextPending (uint &irq)
 Retrieve the next pending interrupt (IRQ). More...
 
virtual bool isTriggered (uint irq)
 Check if an IRQ vector is set. More...
 
virtual Result send (const uint targetCoreId, const uint irq)
 Send an inter-processor-interrupt (IPI). More...
 

Protected Attributes

uint m_base
 Interrupt number base offset. More...
 

Detailed Description

Interrupt controller interface.

Definition at line 35 of file IntController.h.

Member Enumeration Documentation

◆ Result

Result codes.

Enumerator
Success 
InvalidIRQ 
InvalidFrequency 
IOError 
NotFound 

Definition at line 42 of file IntController.h.

Constructor & Destructor Documentation

◆ IntController()

IntController::IntController ( )

Constructor.

Definition at line 20 of file IntController.cpp.

Member Function Documentation

◆ clear()

virtual Result IntController::clear ( uint  irq)
pure virtual

Clear hardware interrupt (IRQ).

Clearing marks the end of an interrupt service routine and causes the controller to trigger the interrupt again on the next trigger moment.

Parameters
irqInterrupt Request number to clear.
Returns
Result code.

Implemented in BroadcomInterrupt, IntelAPIC, ARMGenericInterrupt, and IntelPIC.

Referenced by SunxiKernel::interrupt(), and IntelKernel::interrupt().

◆ disable()

virtual Result IntController::disable ( uint  irq)
pure virtual

Disable hardware interrupt (IRQ).

Parameters
irqInterrupt Request number.
Returns
Result code.

Implemented in BroadcomInterrupt, IntelAPIC, ARMGenericInterrupt, and IntelPIC.

Referenced by Kernel::enableIRQ().

◆ enable()

virtual Result IntController::enable ( uint  irq)
pure virtual

Enable hardware interrupt (IRQ).

Parameters
irqInterrupt Request number.
Returns
Result code.

Implemented in BroadcomInterrupt, IntelAPIC, ARMGenericInterrupt, and IntelPIC.

Referenced by Kernel::enableIRQ(), RaspberryKernel::RaspberryKernel(), and SunxiKernel::SunxiKernel().

◆ getBase()

uint IntController::getBase ( ) const

Get interrupt number base offset.

Some interrupt controllers remap the interrupt numbers to a certain base offset.

Returns
Interrupt number base offset.

Definition at line 25 of file IntController.cpp.

References m_base.

Referenced by Kernel::executeIntVector(), IntelKernel::IntelKernel(), and IntelKernel::interrupt().

◆ isTriggered()

bool IntController::isTriggered ( uint  irq)
virtual

Check if an IRQ vector is set.

Parameters
irqInterrupt number
Returns
True if triggered. False otherwise

Reimplemented in BroadcomInterrupt, and ARMGenericInterrupt.

Definition at line 35 of file IntController.cpp.

Referenced by RaspberryKernel::interrupt().

◆ nextPending()

IntController::Result IntController::nextPending ( uint irq)
virtual

Retrieve the next pending interrupt (IRQ).

Parameters
irqOutputs the next pending interrupt on Success
Returns
Result code.

Reimplemented in ARMGenericInterrupt, and BroadcomInterrupt.

Definition at line 30 of file IntController.cpp.

References NotFound.

Referenced by SunxiKernel::interrupt().

◆ send()

IntController::Result IntController::send ( const uint  targetCoreId,
const uint  irq 
)
virtual

Send an inter-processor-interrupt (IPI).

Parameters
targetCoreIdTarget processor that will receive the interrupt
irqInterrupt number to send
Returns
Result code

Reimplemented in ARMGenericInterrupt.

Definition at line 40 of file IntController.cpp.

References IOError.

Referenced by Kernel::sendIRQ().

Field Documentation

◆ m_base

uint IntController::m_base
protected

Interrupt number base offset.

Definition at line 128 of file IntController.h.

Referenced by getBase(), and IntelPIC::IntelPIC().


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