The Pedigree Project
0.1
|
#include <state.h>
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 X64InterruptState * | construct (class X64ProcessorState &state, bool userMode) |
Private Member Functions | |
X64InterruptState () | |
X64InterruptState (const X64InterruptState &) | |
X64InterruptState & | operator= (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 |
x64 Interrupt State
Definition at line 33 of file x64/state.h.
|
private |
The default constructor
|
private |
The copy-constructor
|
private |
The destructor
|
static |
Construct a dummy interruptstate on the stack given in 'state', which when executed will set the processor to 'state'.
Definition at line 165 of file x64/state.cc.
References X64ProcessorState::getStackPointer(), X64ProcessorState::r10, X64ProcessorState::r11, X64ProcessorState::r12, X64ProcessorState::r13, X64ProcessorState::r14, X64ProcessorState::r15, X64ProcessorState::r8, X64ProcessorState::r9, X64ProcessorState::rax, X64ProcessorState::rbp, X64ProcessorState::rbx, X64ProcessorState::rcx, X64ProcessorState::rdi, X64ProcessorState::rdx, X64ProcessorState::rip, X64ProcessorState::rsi, and X64ProcessorState::rsp.
|
inline |
Get the base-pointer
Definition at line 397 of file x64/state.h.
References m_Rbp.
|
inline |
Get the flags register
Definition at line 419 of file x64/state.h.
References m_Rflags.
|
inline |
Get the instruction-pointer of the next instruction that is executed after the interrupt is processed
Definition at line 389 of file x64/state.h.
References m_Rip.
|
inline |
Get 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
[in] | index | the index of the register (from 0 to getRegisterCount() - 1) |
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
Definition at line 31 of file x64/state.cc.
const char * X64InterruptState::getRegisterName | ( | size_t | index | ) | const |
Get the name of a specific register
[in] | index | the index of the register (from 0 to getRegisterCount() - 1) |
Definition at line 114 of file x64/state.cc.
|
inline |
Get the register's size in bytes
[in] | index | the index of the register (from 0 to getRegisterCount() - 1) |
Definition at line 405 of file x64/state.h.
|
inline |
Get the stack-pointer before the interrupt occured
Definition at line 381 of file x64/state.h.
References m_Rsp.
Referenced by getRegister().
|
inline |
Did the interrupt happen in kernel-mode?
Definition at line 410 of file x64/state.h.
References m_Cs.
|
private |
The assignement operator
|
inline |
Set the base-pointer
[in] | basePointer | the new base-pointer |
Definition at line 401 of file x64/state.h.
References m_Rbp.
|
inline |
Set the flags register
[in] | flags | the new flags |
Definition at line 423 of file x64/state.h.
References m_Rflags.
|
inline |
Set the instruction-pointer
[in] | instructionPointer | the 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
[in] | index | the index of the register (from 0 to getRegisterCount() - 1) |
[in] | value | the 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.
|
inline |
Set the userspace stack-pointer
[in] | stackPointer | the new stack-pointer |
Definition at line 385 of file x64/state.h.
References m_Rsp.
|
private |
|
private |
The error-code (if any)
Definition at line 155 of file x64/state.h.
|
private |
The interrupt number
Definition at line 153 of file x64/state.h.
Referenced by getInterruptNumber().
|
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().
|
private |
The R11 general purpose register
Definition at line 131 of file x64/state.h.
Referenced by getRegister(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R12 general purpose register
Definition at line 129 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R13 general purpose register
Definition at line 127 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R14 general purpose register
Definition at line 125 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R15 general purpose register
Definition at line 123 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R8 general purpose register
Definition at line 137 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().
|
private |
The R9 general purpose register
Definition at line 135 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallParameter(), X64ProcessorState::operator=(), and setRegister().
|
private |
The RAX general purpose register
Definition at line 151 of file x64/state.h.
Referenced by getRegister(), X64SyscallState::getRegister(), X64SyscallState::getSyscallNumber(), X64SyscallState::getSyscallParameter(), X64SyscallState::getSyscallService(), X64ProcessorState::operator=(), and setRegister().
|
private |
The base-pointer
Definition at line 139 of file x64/state.h.
Referenced by getBasePointer(), X64SyscallState::getBasePointer(), getRegister(), X64SyscallState::getRegister(), X64ProcessorState::operator=(), setBasePointer(), X64SyscallState::setBasePointer(), and setRegister().
|
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().
|
private |
The RCX general purpose register
Definition at line 147 of file x64/state.h.
Referenced by getRegister(), X64ProcessorState::operator=(), and setRegister().
|
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().
|
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().
|
private |
The RFlags register
Definition at line 161 of file x64/state.h.
Referenced by getFlags(), getRegister(), X64ProcessorState::operator=(), setFlags(), and setRegister().
|
private |
The instruction-pointer
Definition at line 157 of file x64/state.h.
Referenced by getInstructionPointer(), getRegister(), X64ProcessorState::operator=(), setInstructionPointer(), and setRegister().
|
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().
|
private |
The stack-pointer
Definition at line 163 of file x64/state.h.
Referenced by X64SyscallState::getRegister(), getStackPointer(), X64SyscallState::getStackPointer(), X64ProcessorState::operator=(), setRegister(), setStackPointer(), and X64SyscallState::setStackPointer().
|
private |
The SS segment register
Definition at line 165 of file x64/state.h.