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 | List of all members
X86InterruptManager Class Reference

#include <InterruptManager.h>

+ Inheritance diagram for X86InterruptManager:
+ Collaboration diagram for X86InterruptManager:

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 X86InterruptManagerinstance ()
 
static void initialiseProcessor () INITIALISATION_ONLY
 
- Static Public Member Functions inherited from InterruptManager
static InterruptManagerinstance ()
 
- Static Public Member Functions inherited from SyscallManager
static EXPORTED_PUBLIC SyscallManagerinstance ()
 

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 &)
 
X86InterruptManageroperator= (const X86InterruptManager &)
 
virtual ~X86InterruptManager ()
 

Static Private Member Functions

static void interrupt (InterruptState &interruptState)
 

Private Attributes

struct X86InterruptManager::GateDescriptor PACKED
 
GateDescriptor m_IDT [256]
 
InterruptHandlerm_pHandler [256]
 
InterruptHandlerm_pDbgHandler [256]
 
SyscallHandlerm_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 ()
 

Detailed Description

The interrupt/syscall manager on x86 processors

Definition at line 33 of file kernel/core/processor/x86/InterruptManager.h.

Constructor & Destructor Documentation

X86InterruptManager::X86InterruptManager ( )
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().

+ Here is the caller graph for this function:

X86InterruptManager::X86InterruptManager ( const X86InterruptManager )
private

Copy constructor

Note
NOT implemented
X86InterruptManager::~X86InterruptManager ( )
privatevirtual

The destructor

Definition at line 412 of file x86/InterruptManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

Member Function Documentation

size_t X86InterruptManager::getBreakpointInterruptNumber ( )
virtual

Get the interrupt number of the breakpoint exception

Returns
the interrupt number of the breakpoint exception

Implements InterruptManager.

Definition at line 121 of file x86/InterruptManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

size_t X86InterruptManager::getDebugInterruptNumber ( )
virtual

Get the interrupt number of the debug exception

Returns
the interrupt number of the debug exception

Implements InterruptManager.

Definition at line 125 of file x86/InterruptManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

void X86InterruptManager::initialiseProcessor ( )
static

Initialises this processor's IDTR

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

Definition at line 354 of file x86/InterruptManager.cc.

References PACKED.

Referenced by instance().

+ Here is the caller graph for this function:

static X86InterruptManager& X86InterruptManager::instance ( )
inlinestatic
void X86InterruptManager::interrupt ( InterruptState &  interruptState)
staticprivate

Called when an interrupt was triggered

Parameters
[in]interruptStatereference 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().

+ Here is the caller graph for this function:

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

Assignment operator

Note
NOT implemented

Referenced by instance().

+ Here is the caller graph for this function:

bool X86InterruptManager::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 84 of file x86/InterruptManager.cc.

References UNLIKELY.

Referenced by instance().

+ Here is the caller graph for this function:

bool X86InterruptManager::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 104 of file x86/InterruptManager.cc.

References UNLIKELY.

Referenced by instance().

+ Here is the caller graph for this function:

bool X86InterruptManager::registerSyscallHandler ( Service_t  Service,
SyscallHandler pHandler 
)
virtual

Register a syscall handler

Parameters
[in]Servicethe service number you want to register
[in]pHandlerthe interrupt handler
Returns
true, if successfully registered, false otherwise

Implements SyscallManager.

Definition at line 132 of file x86/InterruptManager.cc.

References UNLIKELY.

Referenced by instance().

+ Here is the caller graph for this function:

void X86InterruptManager::setInterruptGate ( size_t  nInterruptNumber,
uintptr_t  interruptHandler,
bool  bUserspace 
)
private

Sets up an interrupt gate

Parameters
[in]nInterruptNumberthe interrupt number
[in]interruptHandleraddress of the assembler interrupt handler stub
[in]bUserspaceis the userspace allowed to call this callgate?

Definition at line 366 of file x86/InterruptManager.cc.

Referenced by instance(), and X86InterruptManager().

+ Here is the caller graph for this function:

void X86InterruptManager::setTaskGate ( size_t  nInterruptNumber,
uint16_t  tssSeg 
)
private

Sets up a task gate

Parameters
[in]nInterruptNumberthe interrupt number
[in]tssSegthe segment in the GDT for the TSS

Definition at line 376 of file x86/InterruptManager.cc.

Referenced by instance(), and X86InterruptManager().

+ Here is the caller graph for this function:

uintptr_t X86InterruptManager::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 
)
virtual

Calls a syscall.

Implements SyscallManager.

Definition at line 338 of file x86/InterruptManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

Member Data Documentation

GateDescriptor X86InterruptManager::m_IDT[256]
private

The interrupt descriptor table (IDT)

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

X86InterruptManager X86InterruptManager::m_Instance
staticprivate

The instance of the interrupt manager

Definition at line 131 of file kernel/core/processor/x86/InterruptManager.h.

Referenced by instance().

Spinlock X86InterruptManager::m_Lock
private

Lock

Definition at line 128 of file kernel/core/processor/x86/InterruptManager.h.

InterruptHandler* X86InterruptManager::m_pDbgHandler[256]
private

The debugger interrupt handlers

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

Referenced by X86InterruptManager().

InterruptHandler* X86InterruptManager::m_pHandler[256]
private

The normal interrupt handlers

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

Referenced by X86InterruptManager().

SyscallHandler* X86InterruptManager::m_pSyscallHandler[serviceEnd]
private

The syscall handlers

Definition at line 125 of file kernel/core/processor/x86/InterruptManager.h.

Referenced by X86InterruptManager().


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