|
The Pedigree Project 0.1
|
#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 () |
The interrupt manager on x64 processors
Definition at line 36 of file kernel/core/processor/x64/InterruptManager.h.
|
private |
The constructor
Definition at line 424 of file x64/InterruptManager.cc.
References m_BootstrapIDT, m_IDT, m_pDbgHandler, m_pHandler, setInterruptGate(), and setIst().
|
private |
Copy constructor
|
privatevirtual |
The destructor
Definition at line 450 of file x64/InterruptManager.cc.
|
virtual |
Get the interrupt number of the breakpoint exception
Implements InterruptManager.
Definition at line 142 of file x64/InterruptManager.cc.
|
virtual |
Get the interrupt number of the debug exception
Implements InterruptManager.
Definition at line 145 of file x64/InterruptManager.cc.
|
static |
Initialises this processors IDTR
Definition at line 389 of file x64/InterruptManager.cc.
References m_BootstrapIDT, and m_Instance.
|
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:
|
inlinestatic |
Get the X64InterruptManager class instance
Definition at line 42 of file kernel/core/processor/x64/InterruptManager.h.
References m_Instance.
|
staticprivate |
Called when an interrupt was triggered
| [in] | interruptState | reference 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.
|
private |
Assignment operator
|
virtual |
Register an interrupt handler
| [in] | nInterruptNumber | the interrupt's number |
| [in] | pHandler | the interrupt handler |
Implements InterruptManager.
Definition at line 103 of file x64/InterruptManager.cc.
References m_Lock, m_pHandler, and UNLIKELY.
|
virtual |
Register an interrupt handler (for the kernel debugger)
| [in] | nInterruptNumber | the interrupt's number |
| [in] | pHandler | the interrupt handler |
Implements InterruptManager.
Definition at line 125 of file x64/InterruptManager.cc.
References m_Lock, m_pDbgHandler, and UNLIKELY.
|
staticprivate |
Runs ordinary work only after interrupt() has released raw scopes.
Definition at line 311 of file x64/InterruptManager.cc.
References Thread::completeAffinityAtSafePoint(), InterruptTimeAccounting::finishUserReturn(), ProcessorBase::information(), PerProcessorScheduler::sampleUserReturnDiagnostics(), PerProcessorScheduler::serviceUserReturnWork(), and ProcessorBase::setInterrupts().
|
private |
Sets up an interrupt gate
| [in] | interruptNumber | the interrupt number |
| [in] | interruptHandler | address of the assembler interrupt handler stub |
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:
|
private |
Sets the IST field for a given interrupt gate
| [in] | interruptNumber | the interrupt number |
| [in] | ist | IST 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:
|
friend |
Definition at line 37 of file kernel/core/processor/x64/InterruptManager.h.
|
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().
|
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().
|
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().
|
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().
|
private |
The debugger interrupt handlers
Definition at line 122 of file kernel/core/processor/x64/InterruptManager.h.
Referenced by interrupt(), registerInterruptHandlerDebugger(), and X64InterruptManager().
|
private |
The normal interrupt handlers
Definition at line 119 of file kernel/core/processor/x64/InterruptManager.h.
Referenced by interrupt(), registerInterruptHandler(), and X64InterruptManager().