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

#include <state.h>

+ Collaboration diagram for HostedInterruptState:

Public Member Functions

uintptr_t getStackPointer () const
 
void setStackPointer (uintptr_t stackPointer)
 
uintptr_t getInstructionPointer () const
 
void setInstructionPointer (uintptr_t instructionPointer)
 
uintptr_t getBasePointer () const
 
void setBasePointer (uintptr_t basePointer)
 
size_t getRegisterCount () const
 
processor_register_t getRegister (size_t index) const
 
const char * getRegisterName (size_t index) const
 
size_t getRegisterSize (size_t index) const
 
bool kernelMode () const
 
size_t getInterruptNumber () const
 
uint64_t getFlags () const
 
void setFlags (uint64_t flags)
 

Static Public Member Functions

static HostedInterruptStateconstruct (class HostedProcessorState &state, bool userMode)
 

Private Member Functions

 HostedInterruptState ()
 
 HostedInterruptState (const HostedInterruptState &)
 
HostedInterruptStateoperator= (const HostedInterruptState &)
 
 ~HostedInterruptState ()
 

Private Attributes

uint64_t state
 
uint64_t which
 
uint64_t extra
 
uint64_t meta
 
uintptr_t m_basePointer
 
uintptr_t m_instructionPointer
 
uintptr_t m_stackPointer
 

Friends

class HostedProcessorState
 
class HostedInterruptManager
 
class PageFaultHandler
 

Detailed Description

x64 Interrupt State

Definition at line 31 of file hosted/state.h.

Constructor & Destructor Documentation

HostedInterruptState::HostedInterruptState ( )
private

The default constructor

Definition at line 28 of file hosted/state.cc.

HostedInterruptState::HostedInterruptState ( const HostedInterruptState )
private

The copy-constructor

Note
NOT implemented
HostedInterruptState::~HostedInterruptState ( )
private

The destructor

Definition at line 32 of file hosted/state.cc.

Member Function Documentation

HostedInterruptState * HostedInterruptState::construct ( class HostedProcessorState state,
bool  userMode 
)
static

Construct a dummy interruptstate on the stack given in 'state', which when executed will set the processor to 'state'.

Definition at line 71 of file hosted/state.cc.

uintptr_t HostedInterruptState::getBasePointer ( ) const
inline

Get the base-pointer

Returns
the base-pointer

Definition at line 287 of file hosted/state.h.

References m_basePointer.

uint64_t HostedInterruptState::getFlags ( ) const
inline

Get the flags register

Returns
the flags register

Definition at line 309 of file hosted/state.h.

uintptr_t HostedInterruptState::getInstructionPointer ( ) const
inline

Get the instruction-pointer of the next instruction that is executed after the interrupt is processed

Returns
the instruction-pointer

Definition at line 279 of file hosted/state.h.

size_t HostedInterruptState::getInterruptNumber ( ) const
inline

Get the interrupt number

Returns
the interrupt number

Definition at line 304 of file hosted/state.h.

References which.

processor_register_t HostedInterruptState::getRegister ( size_t  index) const

Get a specific register

Parameters
[in]indexthe index of the register (from 0 to getRegisterCount() - 1)
Returns
the value of the register

Definition at line 40 of file hosted/state.cc.

References extra, meta, and state.

size_t HostedInterruptState::getRegisterCount ( ) const

Get the number of registers

Returns
the number of registers

Definition at line 36 of file hosted/state.cc.

const char * HostedInterruptState::getRegisterName ( size_t  index) const

Get the name of a specific register

Parameters
[in]indexthe index of the register (from 0 to getRegisterCount() - 1)
Returns
the name of the register

Definition at line 50 of file hosted/state.cc.

size_t HostedInterruptState::getRegisterSize ( size_t  index) const
inline

Get the register's size in bytes

Parameters
[in]indexthe index of the register (from 0 to getRegisterCount() - 1)
Returns
the register size in bytes

Definition at line 295 of file hosted/state.h.

uintptr_t HostedInterruptState::getStackPointer ( ) const
inline

Get the stack-pointer before the interrupt occured

Returns
the stack-pointer before the interrupt

Definition at line 271 of file hosted/state.h.

bool HostedInterruptState::kernelMode ( ) const
inline

Did the interrupt happen in kernel-mode?

Returns
true, if the interrupt happened in kernel-mode, false otherwise

Definition at line 300 of file hosted/state.h.

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

The assignement operator

Note
NOT implemented
void HostedInterruptState::setBasePointer ( uintptr_t  basePointer)
inline

Set the base-pointer

Parameters
[in]basePointerthe new base-pointer

Definition at line 291 of file hosted/state.h.

References m_basePointer.

void HostedInterruptState::setFlags ( uint64_t  flags)
inline

Set the flags register

Parameters
[in]flagsthe new flags

Definition at line 313 of file hosted/state.h.

void HostedInterruptState::setInstructionPointer ( uintptr_t  instructionPointer)
inline

Set the instruction-pointer

Parameters
[in]instructionPointerthe new instruction-pointer

Definition at line 283 of file hosted/state.h.

void HostedInterruptState::setStackPointer ( uintptr_t  stackPointer)
inline

Set the userspace stack-pointer

Parameters
[in]stackPointerthe new stack-pointer

Definition at line 275 of file hosted/state.h.

Member Data Documentation

uint64_t HostedInterruptState::extra
private

siginfo_t structure

Definition at line 121 of file hosted/state.h.

Referenced by getRegister().

uintptr_t HostedInterruptState::m_basePointer
private

Extra pieces that can be filled before entering debugger.

Definition at line 129 of file hosted/state.h.

Referenced by getBasePointer(), and setBasePointer().

uint64_t HostedInterruptState::meta
private

Third argument to the sigaction handler (has meaning for certain signals such as SIGSEGV).

Definition at line 126 of file hosted/state.h.

Referenced by getRegister().

uint64_t HostedInterruptState::state
private

State data - generally a pointer to the object asking for the interrupt.

Definition at line 117 of file hosted/state.h.

Referenced by getRegister(), and HostedProcessorState::operator=().

uint64_t HostedInterruptState::which
private

Signal number

Definition at line 119 of file hosted/state.h.

Referenced by getInterruptNumber().


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