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

#include <state.h>

+ Collaboration diagram for X86InterruptState:

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 &)
 
X86InterruptStateoperator= (const X86InterruptState &)
 
 ~X86InterruptState ()
 

Static Public Member Functions

static X86InterruptStateconstruct (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
 

Detailed Description

x86 Interrupt State

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

Constructor & Destructor Documentation

X86InterruptState::X86InterruptState ( )

The default constructor

Note
NOT implemented
X86InterruptState::X86InterruptState ( const X86InterruptState )

The copy-constructor

Note
NOT implemented
X86InterruptState::~X86InterruptState ( )

The destructor

Note
NOT implemented

Member Function Documentation

X86InterruptState * X86InterruptState::construct ( class X86ProcessorState 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 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().

uintptr_t X86InterruptState::getBasePointer ( ) const
inline

Get the base-pointer

Returns
the base-pointer

Definition at line 274 of file x86/state.h.

References m_Ebp.

uint32_t X86InterruptState::getFlags ( ) const
inline

Get the flags register

Returns
the flags register

Definition at line 328 of file x86/state.h.

References m_Eflags.

uintptr_t X86InterruptState::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 266 of file x86/state.h.

References m_Eip.

size_t X86InterruptState::getInterruptNumber ( ) const
inline

Get the interrupt number

Returns
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

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

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

Returns
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

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

Definition at line 53 of file x86/state.cc.

size_t X86InterruptState::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 282 of file x86/state.h.

uintptr_t X86InterruptState::getStackPointer ( ) const
inline

Get the stack-pointer before the interrupt occured

Returns
the stack-pointer before the interrupt

Definition at line 255 of file x86/state.h.

References kernelMode(), m_Esp, and m_Res.

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

+ Here is the caller graph for this function:

size_t X86InterruptState::getSyscallNumber ( ) const
inline

Get the syscall function number

Returns
the syscall function number

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

References m_Eax.

uintptr_t X86InterruptState::getSyscallParameter ( size_t  n) const
inline

Get the n'th parameter for this syscall.

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

References Dec, m_Eax, m_Ebx, m_Ecx, m_Edi, m_Edx, m_Esi, and WARNING.

size_t X86InterruptState::getSyscallService ( ) const
inline

Get the syscall service number

Returns
the syscall service number

Definition at line 296 of file x86/state.h.

References m_Eax.

bool X86InterruptState::kernelMode ( ) const
inline

Did the interrupt happen in kernel-mode?

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

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

References m_Cs.

Referenced by getStackPointer(), and setStackPointer().

+ Here is the caller graph for this function:

X86InterruptState& X86InterruptState::operator= ( const X86InterruptState )

The assignement operator

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

Set the base-pointer

Parameters
[in]basePointerthe new base-pointer

Definition at line 278 of file x86/state.h.

References m_Ebp.

void X86InterruptState::setFlags ( uint32_t  flags)
inline

Set the flags register

Parameters
[in]flagsthe new flags

Definition at line 332 of file x86/state.h.

References m_Eflags.

void X86InterruptState::setInstructionPointer ( uintptr_t  instructionPointer)
inline

Set the instruction-pointer

Parameters
[in]instructionPointerthe new instruction-pointer

Definition at line 270 of file x86/state.h.

References m_Eip.

void X86InterruptState::setStackPointer ( uintptr_t  stackPointer)
inline

Set the userspace stack-pointer

Parameters
[in]stackPointerthe new stack-pointer

Definition at line 261 of file x86/state.h.

References kernelMode(), and m_Esp.

Member Data Documentation

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

Reserved/Unused (ESP)

Definition at line 138 of file x86/state.h.

Referenced by getStackPointer().

uint32_t X86InterruptState::m_Ss

The SS segment register

Definition at line 160 of file x86/state.h.


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