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

#include <NMFaultHandler.h>

+ Inheritance diagram for NMFaultHandler:
+ Collaboration diagram for NMFaultHandler:

Public Member Functions

bool initialise ()
 
bool initialiseProcessor ()
 
virtual void interrupt (size_t interruptNumber, InterruptState &state)
 
void threadTerminated (class Thread *)
 

Static Public Member Functions

static NMFaultHandler & instance ()
 
static EXPORTED_PUBLIC bool saveCurrentThreadFpuState (void *buffer, bool resetForSignalHandler)
 
static EXPORTED_PUBLIC bool restoreCurrentThreadFpuState (const void *buffer)
 
static bool inheritCurrentThreadFpuState (class Thread *thread)
 

Private Member Functions

 NMFaultHandler () INITIALISATION_ONLY
 
 NMFaultHandler (const NMFaultHandler &)
 
virtual ~InterruptHandler ()
 

Static Private Attributes

static NMFaultHandler m_Instance
 

Detailed Description

The x86 Device Not Present(NM) Exception handler.

Definition at line 32 of file NMFaultHandler.h.

Constructor & Destructor Documentation

◆ NMFaultHandler() [1/2]

NMFaultHandler::NMFaultHandler ( )
private

The default constructor.

Definition at line 301 of file NMFaultHandler.cc.

◆ NMFaultHandler() [2/2]

NMFaultHandler::NMFaultHandler ( const NMFaultHandler &  )
private

The copy constructor. Note not implemented.

Member Function Documentation

◆ inheritCurrentThreadFpuState()

bool NMFaultHandler::inheritCurrentThreadFpuState ( class Thread *  thread)
static

Seed a new thread with the current thread's floating-point image.

Definition at line 241 of file NMFaultHandler.cc.

References saveCurrentThreadFpuState(), and Thread::state().

Referenced by Thread::Thread().

+ Here is the caller graph for this function:

◆ initialise()

bool NMFaultHandler::initialise ( )

Register the NMFaultHandler with the InterruptManager.

Returns
true if sucessful, false otherwise.

Definition at line 83 of file NMFaultHandler.cc.

References initialiseProcessor(), InterruptManager::instance(), and InterruptManager::registerInterruptHandler().

◆ initialiseProcessor()

bool NMFaultHandler::initialiseProcessor ( )

Initialise the current processor's floating point state.

Definition at line 92 of file NMFaultHandler.cc.

References Spinlock::acquire(), X86CommonProcessor::cpuid(), and Spinlock::release().

Referenced by initialise().

+ Here is the caller graph for this function:

◆ instance()

static NMFaultHandler & NMFaultHandler::instance ( )
inlinestatic

Get the NMFaultHandler instance

Returns
the NMFaultHandler instance.

Definition at line 36 of file NMFaultHandler.h.

References m_Instance.

Referenced by Thread::~Thread().

+ Here is the caller graph for this function:

◆ interrupt()

void NMFaultHandler::interrupt ( size_t  nInterruptNumber,
InterruptState &  state 
)
virtual

Called when the handler is registered with the interrupt manager and the interrupt occurred

Parameters
[in]nInterruptNumberthe interrupt number
[in]statereference to the state before the interrupt

Implements InterruptHandler.

Definition at line 257 of file NMFaultHandler.cc.

References ProcessorBase::information(), and Thread::state().

◆ restoreCurrentThreadFpuState()

bool NMFaultHandler::restoreCurrentThreadFpuState ( const void *  buffer)
static

Restore the current thread's legacy FXSAVE image.

Definition at line 201 of file NMFaultHandler.cc.

References ProcessorBase::getInterrupts(), ProcessorBase::information(), ProcessorBase::setInterrupts(), and Thread::state().

◆ saveCurrentThreadFpuState()

bool NMFaultHandler::saveCurrentThreadFpuState ( void *  buffer,
bool  resetForSignalHandler 
)
static

Save the current thread's legacy FXSAVE image. When requested, install the initial image for a signal handler without losing the saved image.

Definition at line 157 of file NMFaultHandler.cc.

References ProcessorBase::getInterrupts(), ProcessorBase::information(), ProcessorBase::setInterrupts(), and Thread::state().

Referenced by inheritCurrentThreadFpuState().

+ Here is the caller graph for this function:

◆ threadTerminated()

void NMFaultHandler::threadTerminated ( class Thread *  pThread)

Definition at line 303 of file NMFaultHandler.cc.

Member Data Documentation

◆ m_Instance

NMFaultHandler NMFaultHandler::m_Instance
staticprivate

The NMFaultHandler instance

Definition at line 76 of file NMFaultHandler.h.

Referenced by instance().


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