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

#include <InterruptManager.h>

+ Inheritance diagram for HostedInterruptManager:
+ Collaboration diagram for HostedInterruptManager:

Public Member Functions

virtual bool registerInterruptHandler (size_t nInterruptNumber, InterruptHandler *pHandler)
 
virtual bool registerInterruptHandlerDebugger (size_t nInterruptNumber, InterruptHandler *pHandler)
 
virtual size_t getBreakpointInterruptNumber () PURE
 
virtual size_t getDebugInterruptNumber () PURE
 
void signalShim (int which, void *siginfo, void *meta, bool fromUserspace)
 
struct sigaction getOriginalSigaction (int which) const
 

Static Public Member Functions

static HostedInterruptManager & instance ()
 
static void initialiseProcessor () INITIALISATION_ONLY
 
static void quiesceProcessor ()
 
- Static Public Member Functions inherited from InterruptManager
static EXPORTED_PUBLIC InterruptManager & instance ()
 

Private Member Functions

void setInterruptGate (size_t nInterruptNumber, uintptr_t interruptHandler) INITIALISATION_ONLY
 
void setIst (size_t nInterruptNumber, size_t ist)
 
 HostedInterruptManager () INITIALISATION_ONLY
 
 HostedInterruptManager (const HostedInterruptManager &)
 
HostedInterruptManager & operator= (const HostedInterruptManager &)
 
virtual ~HostedInterruptManager ()
 

Static Private Member Functions

static void interrupt (InterruptState &interruptState)
 

Private Attributes

Spinlock m_Lock
 
InterruptHandler * m_pHandler [MAX_SIGNAL]
 
InterruptHandler * m_pDbgHandler [MAX_SIGNAL]
 

Static Private Attributes

static struct sigaction m_OriginalActions [MAX_SIGNAL]
 
static bool m_ActionInstalled [MAX_SIGNAL] = {}
 
static bool m_bQuiesced = false
 
static HostedInterruptManager m_Instance
 

Additional Inherited Members

- Protected Member Functions inherited from InterruptManager
 InterruptManager ()
 
virtual ~InterruptManager ()
 

Detailed Description

The interrupt manager on hosted systems

Definition at line 37 of file kernel/core/processor/hosted/InterruptManager.h.

Constructor & Destructor Documentation

◆ HostedInterruptManager() [1/2]

HostedInterruptManager::HostedInterruptManager ( )
private

The constructor

Definition at line 534 of file hosted/InterruptManager.cc.

References m_pDbgHandler, and m_pHandler.

◆ HostedInterruptManager() [2/2]

HostedInterruptManager::HostedInterruptManager ( const HostedInterruptManager &  )
private

Copy constructor

Note
NOT implemented

◆ ~HostedInterruptManager()

HostedInterruptManager::~HostedInterruptManager ( )
privatevirtual

The destructor

Definition at line 544 of file hosted/InterruptManager.cc.

Member Function Documentation

◆ getBreakpointInterruptNumber()

size_t HostedInterruptManager::getBreakpointInterruptNumber ( )
virtual

Get the interrupt number of the breakpoint exception

Returns
the interrupt number of the breakpoint exception

Implements InterruptManager.

Definition at line 200 of file hosted/InterruptManager.cc.

◆ getDebugInterruptNumber()

size_t HostedInterruptManager::getDebugInterruptNumber ( )
virtual

Get the interrupt number of the debug exception

Returns
the interrupt number of the debug exception

Implements InterruptManager.

Definition at line 203 of file hosted/InterruptManager.cc.

◆ getOriginalSigaction()

struct sigaction HostedInterruptManager::getOriginalSigaction ( int  which) const

Get the original sigaction for an interrupt handler.

Definition at line 441 of file hosted/InterruptManager.cc.

Referenced by interrupt().

+ Here is the caller graph for this function:

◆ initialiseProcessor()

void HostedInterruptManager::initialiseProcessor ( )
static

Initialises this processors IDTR

Note
This should only be called from Processor::initialise1() and Multiprocessor::applicationProcessorStartup()

Definition at line 445 of file hosted/InterruptManager.cc.

References m_OriginalActions.

◆ instance()

static HostedInterruptManager & HostedInterruptManager::instance ( )
inlinestatic

Get the HostedInterruptManager class instance

Returns
instance of the HostedInterruptManager class

Definition at line 41 of file kernel/core/processor/hosted/InterruptManager.h.

References m_Instance.

◆ interrupt()

void HostedInterruptManager::interrupt ( InterruptState &  interruptState)
staticprivate

Called when an interrupt was triggered

Parameters
[in]interruptStatereference to the usermode/kernel state before the interrupt
Todo:
Provide a better entry point for system shutdown.

Definition at line 209 of file hosted/InterruptManager.cc.

References Thread::deferSubsystemException(), getOriginalSigaction(), Thread::getParent(), ProcessorBase::information(), Debugger::instance(), InterruptManager::instance(), InterruptHandler::interrupt(), LIKELY, m_Instance, m_pDbgHandler, m_pHandler, panic(), ProcessorBase::reset(), Debugger::start(), and UNLIKELY.

Referenced by signalShim().

+ Here is the caller graph for this function:

◆ operator=()

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

Assignment operator

Note
NOT implemented

◆ quiesceProcessor()

void HostedInterruptManager::quiesceProcessor ( )
static

Stops hosted IRQ signal delivery before global teardown.

Definition at line 475 of file hosted/InterruptManager.cc.

References m_OriginalActions.

Referenced by HostedMachine::deinitialise().

+ Here is the caller graph for this function:

◆ registerInterruptHandler()

bool HostedInterruptManager::registerInterruptHandler ( size_t  nInterruptNumber,
InterruptHandler *  pHandler 
)
virtual

Register an interrupt handler

Parameters
[in]nInterruptNumberthe interrupt's number
[in]pHandlerthe interrupt handler
Returns
true, if successfully registered, false otherwise

Implements InterruptManager.

Definition at line 161 of file hosted/InterruptManager.cc.

References m_Lock, m_pHandler, and UNLIKELY.

◆ registerInterruptHandlerDebugger()

bool HostedInterruptManager::registerInterruptHandlerDebugger ( size_t  nInterruptNumber,
InterruptHandler *  pHandler 
)
virtual

Register an interrupt handler (for the kernel debugger)

Parameters
[in]nInterruptNumberthe interrupt's number
[in]pHandlerthe interrupt handler
Returns
true, if successfully registered, false otherwise

Implements InterruptManager.

Definition at line 183 of file hosted/InterruptManager.cc.

References m_Lock, m_pDbgHandler, and UNLIKELY.

◆ setInterruptGate()

void HostedInterruptManager::setInterruptGate ( size_t  nInterruptNumber,
uintptr_t  interruptHandler 
)
private

Sets up an interrupt gate

Parameters
[in]interruptNumberthe interrupt number
[in]interruptHandleraddress of the assembler interrupt handler stub
Note
This function is defined in kernel/processor/ARCH/interrupt.cc

◆ setIst()

void HostedInterruptManager::setIst ( size_t  nInterruptNumber,
size_t  ist 
)
private

Sets the IST field for a given interrupt gate

Parameters
[in]interruptNumberthe interrupt number
[in]istIST index to use

◆ signalShim()

void HostedInterruptManager::signalShim ( int  which,
void *  siginfo,
void *  meta,
bool  fromUserspace 
)

Signal handling shim for InterruptState protected access.

Definition at line 326 of file hosted/InterruptManager.cc.

References InterruptTimeAccounting::finishUserReturn(), ProcessorBase::getInterrupts(), ProcessorBase::information(), interrupt(), and ProcessorBase::setInterrupts().

Member Data Documentation

◆ m_ActionInstalled

bool HostedInterruptManager::m_ActionInstalled = {}
staticprivate

◆ m_bQuiesced

bool HostedInterruptManager::m_bQuiesced = false
staticprivate

◆ m_Instance

HostedInterruptManager HostedInterruptManager::m_Instance
staticprivate

The instance of the interrupt manager

Definition at line 119 of file kernel/core/processor/hosted/InterruptManager.h.

Referenced by instance(), and interrupt().

◆ m_Lock

Spinlock HostedInterruptManager::m_Lock
private

Serialises handler pointer mutations. Dispatch never takes this lock.

Definition at line 103 of file kernel/core/processor/hosted/InterruptManager.h.

Referenced by registerInterruptHandler(), and registerInterruptHandlerDebugger().

◆ m_OriginalActions

struct sigaction HostedInterruptManager::m_OriginalActions[MAX_SIGNAL]
staticprivate

Original sigaction structs after we install our custom handlers.

Definition at line 113 of file kernel/core/processor/hosted/InterruptManager.h.

Referenced by initialiseProcessor(), and quiesceProcessor().

◆ m_pDbgHandler

InterruptHandler* HostedInterruptManager::m_pDbgHandler[MAX_SIGNAL]
private

The debugger interrupt handlers

Definition at line 109 of file kernel/core/processor/hosted/InterruptManager.h.

Referenced by HostedInterruptManager(), interrupt(), and registerInterruptHandlerDebugger().

◆ m_pHandler

InterruptHandler* HostedInterruptManager::m_pHandler[MAX_SIGNAL]
private

The normal interrupt handlers

Definition at line 106 of file kernel/core/processor/hosted/InterruptManager.h.

Referenced by HostedInterruptManager(), interrupt(), and registerInterruptHandler().


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