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

#include <state.h>

+ Collaboration diagram for X64InterruptState:

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
 
void setRegister (size_t index, uintptr_t value)
 
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 X64InterruptStateconstruct (class X64ProcessorState &state, bool userMode)
 

Private Member Functions

 X64InterruptState ()
 
 X64InterruptState (const X64InterruptState &)
 
X64InterruptStateoperator= (const X64InterruptState &)
 
 ~X64InterruptState ()
 

Private Attributes

uint64_t m_R15
 
uint64_t m_R14
 
uint64_t m_R13
 
uint64_t m_R12
 
uint64_t m_R11
 
uint64_t m_R10
 
uint64_t m_R9
 
uint64_t m_R8
 
uint64_t m_Rbp
 
uint64_t m_Rsi
 
uint64_t m_Rdi
 
uint64_t m_Rdx
 
uint64_t m_Rcx
 
uint64_t m_Rbx
 
uint64_t m_Rax
 
uint64_t m_IntNumber
 
uint64_t m_Errorcode
 
uint64_t m_Rip
 
uint64_t m_Cs
 
uint64_t m_Rflags
 
uint64_t m_Rsp
 
uint64_t m_Ss
 

Friends

class X64ProcessorState
 
class X64InterruptManager
 
class PageFaultHandler
 

Detailed Description

x64 Interrupt State

Definition at line 33 of file x64/state.h.

Constructor & Destructor Documentation

X64InterruptState::X64InterruptState ( )
private

The default constructor

Note
NOT implemented
X64InterruptState::X64InterruptState ( const X64InterruptState )
private

The copy-constructor

Note
NOT implemented
X64InterruptState::~X64InterruptState ( )
private

The destructor

Note
NOT implemented

Member Function Documentation

X64InterruptState * X64InterruptState::construct ( class X64ProcessorState state,
bool  userMode 
)
static
uintptr_t X64InterruptState::getBasePointer ( ) const
inline

Get the base-pointer

Returns
the base-pointer

Definition at line 397 of file x64/state.h.

References m_Rbp.

uint64_t X64InterruptState::getFlags ( ) const
inline

Get the flags register

Returns
the flags register

Definition at line 419 of file x64/state.h.

References m_Rflags.

uintptr_t X64InterruptState::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 389 of file x64/state.h.

References m_Rip.

size_t X64InterruptState::getInterruptNumber ( ) const
inline

Get the interrupt number

Returns
the interrupt number

Definition at line 414 of file x64/state.h.

References m_IntNumber.

processor_register_t X64InterruptState::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 35 of file x64/state.cc.

References getStackPointer(), m_R10, m_R11, m_R12, m_R13, m_R14, m_R15, m_R8, m_R9, m_Rax, m_Rbp, m_Rbx, m_Rcx, m_Rdi, m_Rdx, m_Rflags, m_Rip, and m_Rsi.

size_t X64InterruptState::getRegisterCount ( ) const

Get the number of registers

Returns
the number of registers

Definition at line 31 of file x64/state.cc.

const char * X64InterruptState::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 114 of file x64/state.cc.

size_t X64InterruptState::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 405 of file x64/state.h.

uintptr_t X64InterruptState::getStackPointer ( ) const
inline

Get the stack-pointer before the interrupt occured

Returns
the stack-pointer before the interrupt

Definition at line 381 of file x64/state.h.

References m_Rsp.

Referenced by getRegister().

+ Here is the caller graph for this function:

bool X64InterruptState::kernelMode ( ) const
inline

Did the interrupt happen in kernel-mode?

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

Definition at line 410 of file x64/state.h.

References m_Cs.

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

The assignement operator

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

Set the base-pointer

Parameters
[in]basePointerthe new base-pointer

Definition at line 401 of file x64/state.h.

References m_Rbp.

void X64InterruptState::setFlags ( uint64_t  flags)
inline

Set the flags register

Parameters
[in]flagsthe new flags

Definition at line 423 of file x64/state.h.

References m_Rflags.

void X64InterruptState::setInstructionPointer ( uintptr_t  instructionPointer)
inline

Set the instruction-pointer

Parameters
[in]instructionPointerthe new instruction-pointer

Definition at line 393 of file x64/state.h.

References m_Rip.

void X64InterruptState::setRegister ( size_t  index,
uintptr_t  value 
)

Set a specific register

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

Definition at line 75 of file x64/state.cc.

References m_R10, m_R11, m_R12, m_R13, m_R14, m_R15, m_R8, m_R9, m_Rax, m_Rbp, m_Rbx, m_Rcx, m_Rdi, m_Rdx, m_Rflags, m_Rip, m_Rsi, and m_Rsp.

void X64InterruptState::setStackPointer ( uintptr_t  stackPointer)
inline

Set the userspace stack-pointer

Parameters
[in]stackPointerthe new stack-pointer

Definition at line 385 of file x64/state.h.

References m_Rsp.

Member Data Documentation

uint64_t X64InterruptState::m_Cs
private

The CS segment register

Definition at line 159 of file x64/state.h.

Referenced by kernelMode().

uint64_t X64InterruptState::m_Errorcode
private

The error-code (if any)

Definition at line 155 of file x64/state.h.

uint64_t X64InterruptState::m_IntNumber
private

The interrupt number

Definition at line 153 of file x64/state.h.

Referenced by getInterruptNumber().

uint64_t X64InterruptState::m_R10
private

The R10 general purpose register

Definition at line 133 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R11
private

The R11 general purpose register

Definition at line 131 of file x64/state.h.

Referenced by getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R12
private

The R12 general purpose register

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

Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R13
private

The R13 general purpose register

Definition at line 127 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R14
private

The R14 general purpose register

Definition at line 125 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R15
private

The R15 general purpose register

Definition at line 123 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_R8
private
uint64_t X64InterruptState::m_R9
private
uint64_t X64InterruptState::m_Rax
private
uint64_t X64InterruptState::m_Rbp
private
uint64_t X64InterruptState::m_Rbx
private

The RBX general purpose register

Definition at line 149 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_Rcx
private

The RCX general purpose register

Definition at line 147 of file x64/state.h.

Referenced by getRegister(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_Rdi
private

The RDI general purpose register

Definition at line 143 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_Rdx
private

The RDX general purpose register

Definition at line 145 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_Rflags
private

The RFlags register

Definition at line 161 of file x64/state.h.

Referenced by getFlags(), getRegister(), X64ProcessorState::operator=(), setFlags(), and setRegister().

uint64_t X64InterruptState::m_Rip
private

The instruction-pointer

Definition at line 157 of file x64/state.h.

Referenced by getInstructionPointer(), getRegister(), X64ProcessorState::operator=(), setInstructionPointer(), and setRegister().

uint64_t X64InterruptState::m_Rsi
private

The RSI general purpose register

Definition at line 141 of file x64/state.h.

Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().

uint64_t X64InterruptState::m_Rsp
private
uint64_t X64InterruptState::m_Ss
private

The SS segment register

Definition at line 165 of file x64/state.h.


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