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 |
const char * | getRegisterName (size_t index) const |
size_t | getRegisterSize (size_t index) const |
bool | kernelMode () const |
size_t | getInterruptNumber () const |
size_t | getSyscallService () const |
size_t | getSyscallNumber () const |
uintptr_t | getSyscallParameter (size_t n) const |
void | setSyscallReturnValue (uintptr_t val) |
uint32_t | getFlags () const |
void | setFlags (uint32_t flags) |
X86InterruptState () | |
X86InterruptState (const X86InterruptState &) | |
X86InterruptState & | operator= (const X86InterruptState &) |
~X86InterruptState () | |
Static Public Member Functions | |
static X86InterruptState * | construct (class X86ProcessorState &state, bool userMode) |
Public Attributes | |
uint32_t | m_Ds |
uint32_t | m_Edi |
uint32_t | m_Esi |
uint32_t | m_Ebp |
uint32_t | m_Res |
uint32_t | m_Ebx |
uint32_t | m_Edx |
uint32_t | m_Ecx |
uint32_t | m_Eax |
uint32_t | m_IntNumber |
uint32_t | m_Errorcode |
uint32_t | m_Eip |
uint32_t | m_Cs |
uint32_t | m_Eflags |
uint32_t | m_Esp |
uint32_t | m_Ss |
Friends | |
class | X86ProcessorState |
class | X86InterruptManager |
class | PageFaultHandler |
x86 Interrupt State
Definition at line 31 of file x86/state.h.
X86InterruptState::X86InterruptState | ( | ) |
The default constructor
X86InterruptState::X86InterruptState | ( | const X86InterruptState & | ) |
The copy-constructor
X86InterruptState::~X86InterruptState | ( | ) |
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 59 of file x86/state.cc.
References X86ProcessorState::eax, X86ProcessorState::ebp, X86ProcessorState::ebx, X86ProcessorState::ecx, X86ProcessorState::edi, X86ProcessorState::edx, X86ProcessorState::eip, X86ProcessorState::esi, X86ProcessorState::esp, and X86ProcessorState::getStackPointer().
|
inline |
Get the base-pointer
Definition at line 274 of file x86/state.h.
References m_Ebp.
|
inline |
Get the flags register
Definition at line 328 of file x86/state.h.
References m_Eflags.
|
inline |
Get the instruction-pointer of the next instruction that is executed after the interrupt is processed
Definition at line 266 of file x86/state.h.
References m_Eip.
|
inline |
Get the interrupt number
Definition at line 291 of file x86/state.h.
References m_IntNumber.
processor_register_t X86InterruptState::getRegister | ( | size_t | index | ) | const |
Get a specific register
[in] | index | the index of the register (from 0 to getRegisterCount() - 1) |
Definition at line 29 of file x86/state.cc.
References getStackPointer(), m_Eax, m_Ebp, m_Ebx, m_Ecx, m_Edi, m_Edx, m_Eflags, m_Eip, and m_Esi.
size_t X86InterruptState::getRegisterCount | ( | ) | const |
Get the number of registers
Definition at line 25 of file x86/state.cc.
const char * X86InterruptState::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 53 of file x86/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 282 of file x86/state.h.
|
inline |
Get the stack-pointer before the interrupt occured
Definition at line 255 of file x86/state.h.
References kernelMode(), m_Esp, and m_Res.
Referenced by getRegister(), and X86ProcessorState::operator=().
|
inline |
Get the syscall function number
Definition at line 300 of file x86/state.h.
References m_Eax.
|
inline |
|
inline |
Get the syscall service number
Definition at line 296 of file x86/state.h.
References m_Eax.
|
inline |
Did the interrupt happen in kernel-mode?
Definition at line 287 of file x86/state.h.
References m_Cs.
Referenced by getStackPointer(), and setStackPointer().
X86InterruptState& X86InterruptState::operator= | ( | const X86InterruptState & | ) |
The assignement operator
|
inline |
Set the base-pointer
[in] | basePointer | the new base-pointer |
Definition at line 278 of file x86/state.h.
References m_Ebp.
|
inline |
Set the flags register
[in] | flags | the new flags |
Definition at line 332 of file x86/state.h.
References m_Eflags.
|
inline |
Set the instruction-pointer
[in] | instructionPointer | the new instruction-pointer |
Definition at line 270 of file x86/state.h.
References m_Eip.
|
inline |
Set the userspace stack-pointer
[in] | stackPointer | the new stack-pointer |
Definition at line 261 of file x86/state.h.
References kernelMode(), and m_Esp.
uint32_t X86InterruptState::m_Cs |
The CS segment register (zero-extended to 32bit)
Definition at line 154 of file x86/state.h.
Referenced by kernelMode().
uint32_t X86InterruptState::m_Ds |
The DS segment register (zero-extended to 32bit)
Definition at line 130 of file x86/state.h.
uint32_t X86InterruptState::m_Eax |
The EAX general purpose register
Definition at line 146 of file x86/state.h.
Referenced by getRegister(), getSyscallNumber(), getSyscallParameter(), getSyscallService(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Ebp |
The base-pointer register
Definition at line 136 of file x86/state.h.
Referenced by getBasePointer(), getRegister(), X86ProcessorState::operator=(), and setBasePointer().
uint32_t X86InterruptState::m_Ebx |
The EBX general purpose register
Definition at line 140 of file x86/state.h.
Referenced by getRegister(), getSyscallParameter(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Ecx |
The ECX general purpose register
Definition at line 144 of file x86/state.h.
Referenced by getRegister(), getSyscallParameter(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Edi |
The EDI general purpose register
Definition at line 132 of file x86/state.h.
Referenced by getRegister(), getSyscallParameter(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Edx |
The EDX general purpose register
Definition at line 142 of file x86/state.h.
Referenced by getRegister(), getSyscallParameter(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Eflags |
The extended flags (EFLAGS)
Definition at line 156 of file x86/state.h.
Referenced by getFlags(), getRegister(), X86ProcessorState::operator=(), and setFlags().
uint32_t X86InterruptState::m_Eip |
The instruction pointer
Definition at line 152 of file x86/state.h.
Referenced by getInstructionPointer(), getRegister(), X86ProcessorState::operator=(), and setInstructionPointer().
uint32_t X86InterruptState::m_Errorcode |
The error-code (if any)
Definition at line 150 of file x86/state.h.
uint32_t X86InterruptState::m_Esi |
The ESI general purpose register
Definition at line 134 of file x86/state.h.
Referenced by getRegister(), getSyscallParameter(), and X86ProcessorState::operator=().
uint32_t X86InterruptState::m_Esp |
The stack-pointer
Definition at line 158 of file x86/state.h.
Referenced by getStackPointer(), and setStackPointer().
uint32_t X86InterruptState::m_IntNumber |
The interrupt number
Definition at line 148 of file x86/state.h.
Referenced by getInterruptNumber().
uint32_t X86InterruptState::m_Res |
uint32_t X86InterruptState::m_Ss |
The SS segment register
Definition at line 160 of file x86/state.h.