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

#include <InterruptManager.h>

+ Inheritance diagram for X64InterruptManager:
+ Collaboration diagram for X64InterruptManager:

Classes

struct  GateDescriptor
 

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
 

Static Public Member Functions

static X64InterruptManager & instance ()
 
static void initialiseProcessor () INITIALISATION_ONLY
 
static void initialiseProcessorIst () INITIALISATION_ONLY
 
- 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)
 
 X64InterruptManager () INITIALISATION_ONLY
 
 X64InterruptManager (const X64InterruptManager &)
 
X64InterruptManager & operator= (const X64InterruptManager &)
 
virtual ~X64InterruptManager ()
 

Static Private Member Functions

static void interrupt (InterruptState &interruptState) USED
 
static void returnFromInterrupt (InterruptState &interruptState) USED
 

Private Attributes

struct X64InterruptManager::GateDescriptor PACKED
 
Spinlock m_Lock
 
GateDescriptor m_IDT [256]
 
GateDescriptor m_BootstrapIDT [256]
 
InterruptHandler * m_pHandler [256]
 
InterruptHandler * m_pDbgHandler [256]
 

Static Private Attributes

static X64InterruptManager m_Instance
 

Friends

class ProcessorBase
 

Additional Inherited Members

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

Detailed Description

The interrupt manager on x64 processors

Definition at line 36 of file kernel/core/processor/x64/InterruptManager.h.

Constructor & Destructor Documentation

◆ X64InterruptManager() [1/2]

X64InterruptManager::X64InterruptManager ( )
private

The constructor

Definition at line 424 of file x64/InterruptManager.cc.

References m_BootstrapIDT, m_IDT, m_pDbgHandler, m_pHandler, setInterruptGate(), and setIst().

◆ X64InterruptManager() [2/2]

X64InterruptManager::X64InterruptManager ( const X64InterruptManager &  )
private

Copy constructor

Note
NOT implemented

◆ ~X64InterruptManager()

X64InterruptManager::~X64InterruptManager ( )
privatevirtual

The destructor

Definition at line 450 of file x64/InterruptManager.cc.

Member Function Documentation

◆ getBreakpointInterruptNumber()

size_t X64InterruptManager::getBreakpointInterruptNumber ( )
virtual

Get the interrupt number of the breakpoint exception

Returns
the interrupt number of the breakpoint exception

Implements InterruptManager.

Definition at line 142 of file x64/InterruptManager.cc.

◆ getDebugInterruptNumber()

size_t X64InterruptManager::getDebugInterruptNumber ( )
virtual

Get the interrupt number of the debug exception

Returns
the interrupt number of the debug exception

Implements InterruptManager.

Definition at line 145 of file x64/InterruptManager.cc.

◆ initialiseProcessor()

void X64InterruptManager::initialiseProcessor ( )
static

Initialises this processors IDTR

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

Definition at line 389 of file x64/InterruptManager.cc.

References m_BootstrapIDT, and m_Instance.

◆ initialiseProcessorIst()

void X64InterruptManager::initialiseProcessorIst ( )
static

Enables IST entries only after this processor has loaded its permanent TSS.

Definition at line 399 of file x64/InterruptManager.cc.

References m_IDT, and m_Instance.

Referenced by X64GdtManager::initialiseProcessor().

+ Here is the caller graph for this function:

◆ instance()

static X64InterruptManager & X64InterruptManager::instance ( )
inlinestatic

Get the X64InterruptManager class instance

Returns
instance of the X64InterruptManager class

Definition at line 42 of file kernel/core/processor/x64/InterruptManager.h.

References m_Instance.

◆ interrupt()

void X64InterruptManager::interrupt ( InterruptState &  interruptState)
staticprivate

Called when an interrupt was triggered

Parameters
[in]interruptStatereference to the usermode/kernel state before the interrupt

Definition at line 151 of file x64/InterruptManager.cc.

References Thread::deferSubsystemException(), Process::getId(), Thread::getId(), Thread::getParent(), Hex, ProcessorBase::id(), ProcessorBase::information(), Debugger::instance(), KernelElf::instance(), InterruptHandler::interrupt(), LIKELY, m_Instance, m_pDbgHandler, m_pHandler, panic(), Debugger::start(), and UNLIKELY.

◆ operator=()

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

Assignment operator

Note
NOT implemented

◆ registerInterruptHandler()

bool X64InterruptManager::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 103 of file x64/InterruptManager.cc.

References m_Lock, m_pHandler, and UNLIKELY.

◆ registerInterruptHandlerDebugger()

bool X64InterruptManager::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 125 of file x64/InterruptManager.cc.

References m_Lock, m_pDbgHandler, and UNLIKELY.

◆ returnFromInterrupt()

void X64InterruptManager::returnFromInterrupt ( InterruptState &  interruptState)
staticprivate

◆ setInterruptGate()

void X64InterruptManager::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

Definition at line 408 of file x64/InterruptManager.cc.

References X64InterruptManager::GateDescriptor::flags, X64InterruptManager::GateDescriptor::ist, m_IDT, X64InterruptManager::GateDescriptor::offset0, X64InterruptManager::GateDescriptor::offset1, X64InterruptManager::GateDescriptor::offset2, X64InterruptManager::GateDescriptor::res, and X64InterruptManager::GateDescriptor::selector.

Referenced by X64InterruptManager().

+ Here is the caller graph for this function:

◆ setIst()

void X64InterruptManager::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

Definition at line 418 of file x64/InterruptManager.cc.

References X64InterruptManager::GateDescriptor::ist, and m_IDT.

Referenced by X64InterruptManager().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ProcessorBase

friend class ProcessorBase
friend

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

Member Data Documentation

◆ m_BootstrapIDT

GateDescriptor X64InterruptManager::m_BootstrapIDT[256]
private

Early BSP/AP entries cannot use a TSS that has not been loaded yet.

Definition at line 117 of file kernel/core/processor/x64/InterruptManager.h.

Referenced by initialiseProcessor(), and X64InterruptManager().

◆ m_IDT

GateDescriptor X64InterruptManager::m_IDT[256]
private

The interrupt descriptor table (IDT)

Definition at line 115 of file kernel/core/processor/x64/InterruptManager.h.

Referenced by initialiseProcessorIst(), setInterruptGate(), setIst(), and X64InterruptManager().

◆ m_Instance

X64InterruptManager X64InterruptManager::m_Instance
staticprivate

The instance of the interrupt manager

Definition at line 126 of file kernel/core/processor/x64/InterruptManager.h.

Referenced by initialiseProcessor(), initialiseProcessorIst(), instance(), and interrupt().

◆ m_Lock

Spinlock X64InterruptManager::m_Lock
private

Serialises handler pointer mutations. Dispatch never takes this lock.

Definition at line 112 of file kernel/core/processor/x64/InterruptManager.h.

Referenced by registerInterruptHandler(), and registerInterruptHandlerDebugger().

◆ m_pDbgHandler

InterruptHandler* X64InterruptManager::m_pDbgHandler[256]
private

The debugger interrupt handlers

Definition at line 122 of file kernel/core/processor/x64/InterruptManager.h.

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

◆ m_pHandler

InterruptHandler* X64InterruptManager::m_pHandler[256]
private

The normal interrupt handlers

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

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


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