The Pedigree Project
0.1
|
#include <InterruptManager.h>
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 |
virtual bool | registerSyscallHandler (Service_t Service, SyscallHandler *pHandler) |
virtual uintptr_t | syscall (Service_t service, uintptr_t function, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0, uintptr_t p5=0) |
Static Public Member Functions | |
static X86InterruptManager & | instance () |
static void | initialiseProcessor () INITIALISATION_ONLY |
Static Public Member Functions inherited from InterruptManager | |
static InterruptManager & | instance () |
Static Public Member Functions inherited from SyscallManager | |
static EXPORTED_PUBLIC SyscallManager & | instance () |
Private Member Functions | |
void | setInterruptGate (size_t nInterruptNumber, uintptr_t interruptHandler, bool bUserspace) INITIALISATION_ONLY |
void | setTaskGate (size_t nInterruptNumber, uint16_t tssSeg) INITIALISATION_ONLY |
X86InterruptManager () INITIALISATION_ONLY | |
X86InterruptManager (const X86InterruptManager &) | |
X86InterruptManager & | operator= (const X86InterruptManager &) |
virtual | ~X86InterruptManager () |
Static Private Member Functions | |
static void | interrupt (InterruptState &interruptState) |
Private Attributes | |
struct X86InterruptManager::GateDescriptor | PACKED |
GateDescriptor | m_IDT [256] |
InterruptHandler * | m_pHandler [256] |
InterruptHandler * | m_pDbgHandler [256] |
SyscallHandler * | m_pSyscallHandler [serviceEnd] |
Spinlock | m_Lock |
Static Private Attributes | |
static X86InterruptManager | m_Instance |
Additional Inherited Members | |
Protected Member Functions inherited from InterruptManager | |
InterruptManager () | |
virtual | ~InterruptManager () |
Protected Member Functions inherited from SyscallManager | |
SyscallManager () | |
virtual | ~SyscallManager () |
The interrupt/syscall manager on x86 processors
Definition at line 33 of file kernel/core/processor/x86/InterruptManager.h.
|
private |
The constructor
Definition at line 385 of file x86/InterruptManager.cc.
References m_pDbgHandler, m_pHandler, m_pSyscallHandler, setInterruptGate(), and setTaskGate().
Referenced by instance().
|
private |
Copy constructor
|
privatevirtual |
The destructor
Definition at line 412 of file x86/InterruptManager.cc.
Referenced by instance().
|
virtual |
Get the interrupt number of the breakpoint exception
Implements InterruptManager.
Definition at line 121 of file x86/InterruptManager.cc.
Referenced by instance().
|
virtual |
Get the interrupt number of the debug exception
Implements InterruptManager.
Definition at line 125 of file x86/InterruptManager.cc.
Referenced by instance().
|
static |
Initialises this processor's IDTR
Definition at line 354 of file x86/InterruptManager.cc.
References PACKED.
Referenced by instance().
|
inlinestatic |
Get the X86InterruptManager class instance
Definition at line 38 of file kernel/core/processor/x86/InterruptManager.h.
References getBreakpointInterruptNumber(), getDebugInterruptNumber(), INITIALISATION_ONLY, initialiseProcessor(), interrupt(), m_Instance, operator=(), PURE, registerInterruptHandler(), registerInterruptHandlerDebugger(), registerSyscallHandler(), setInterruptGate(), setTaskGate(), syscall(), X86InterruptManager(), and ~X86InterruptManager().
|
staticprivate |
Called when an interrupt was triggered
[in] | interruptState | reference to the usermode/kernel state before the interrupt |
Definition at line 148 of file x86/InterruptManager.cc.
References Thread::Exit, Thread::getParent(), Processor::information(), Debugger::instance(), InterruptHandler::interrupt(), LIKELY, NOTICE, panic(), Debugger::start(), SyscallHandler::syscall(), Subsystem::threadException(), and UNLIKELY.
Referenced by instance().
|
private |
Assignment operator
Referenced by instance().
|
virtual |
Register an interrupt handler
[in] | nInterruptNumber | the interrupt's number |
[in] | pHandler | the interrupt handler |
Implements InterruptManager.
Definition at line 84 of file x86/InterruptManager.cc.
References UNLIKELY.
Referenced by instance().
|
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 104 of file x86/InterruptManager.cc.
References UNLIKELY.
Referenced by instance().
|
virtual |
Register a syscall handler
[in] | Service | the service number you want to register |
[in] | pHandler | the interrupt handler |
Implements SyscallManager.
Definition at line 132 of file x86/InterruptManager.cc.
References UNLIKELY.
Referenced by instance().
|
private |
Sets up an interrupt gate
[in] | nInterruptNumber | the interrupt number |
[in] | interruptHandler | address of the assembler interrupt handler stub |
[in] | bUserspace | is the userspace allowed to call this callgate? |
Definition at line 366 of file x86/InterruptManager.cc.
Referenced by instance(), and X86InterruptManager().
|
private |
Sets up a task gate
[in] | nInterruptNumber | the interrupt number |
[in] | tssSeg | the segment in the GDT for the TSS |
Definition at line 376 of file x86/InterruptManager.cc.
Referenced by instance(), and X86InterruptManager().
|
virtual |
Calls a syscall.
Implements SyscallManager.
Definition at line 338 of file x86/InterruptManager.cc.
Referenced by instance().
|
private |
The interrupt descriptor table (IDT)
Definition at line 117 of file kernel/core/processor/x86/InterruptManager.h.
|
staticprivate |
The instance of the interrupt manager
Definition at line 131 of file kernel/core/processor/x86/InterruptManager.h.
Referenced by instance().
|
private |
Lock
Definition at line 128 of file kernel/core/processor/x86/InterruptManager.h.
|
private |
The debugger interrupt handlers
Definition at line 122 of file kernel/core/processor/x86/InterruptManager.h.
Referenced by X86InterruptManager().
|
private |
The normal interrupt handlers
Definition at line 119 of file kernel/core/processor/x86/InterruptManager.h.
Referenced by X86InterruptManager().
|
private |
The syscall handlers
Definition at line 125 of file kernel/core/processor/x86/InterruptManager.h.
Referenced by X86InterruptManager().