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

#include <state.h>

+ Collaboration diagram for PPC32InterruptState:

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)
 
 PPC32InterruptState ()
 
 PPC32InterruptState (const PPC32InterruptState &)
 
PPC32InterruptStateoperator= (const PPC32InterruptState &)
 
 ~PPC32InterruptState ()
 

Static Public Member Functions

static PPC32InterruptStateconstruct (PPC32ProcessorState &state, bool userMode)
 

Public Attributes

uint32_t m_IntNumber
 
uint32_t m_Xer
 
uint32_t m_Ctr
 
uint32_t m_Lr
 
uint32_t m_Cr
 
uint32_t m_Srr0
 
uint32_t m_Srr1
 
uint32_t m_Dsisr
 
uint32_t m_Dar
 
uint32_t m_R0
 
uint32_t m_R1
 
uint32_t m_R2
 
uint32_t m_R3
 
uint32_t m_R4
 
uint32_t m_R5
 
uint32_t m_R6
 
uint32_t m_R7
 
uint32_t m_R8
 
uint32_t m_R9
 
uint32_t m_R10
 
uint32_t m_R11
 
uint32_t m_R12
 
uint32_t m_R13
 
uint32_t m_R14
 
uint32_t m_R15
 
uint32_t m_R16
 
uint32_t m_R17
 
uint32_t m_R18
 
uint32_t m_R19
 
uint32_t m_R20
 
uint32_t m_R21
 
uint32_t m_R22
 
uint32_t m_R23
 
uint32_t m_R24
 
uint32_t m_R25
 
uint32_t m_R26
 
uint32_t m_R27
 
uint32_t m_R28
 
uint32_t m_R29
 
uint32_t m_R30
 
uint32_t m_R31
 

Detailed Description

PPC32 Interrupt State

Definition at line 34 of file ppc32/state.h.

Constructor & Destructor Documentation

PPC32InterruptState::PPC32InterruptState ( )

The default constructor

Note
NOT implemented

Definition at line 30 of file ppc32/state.cc.

PPC32InterruptState::PPC32InterruptState ( const PPC32InterruptState is)

The copy-constructor

Note
NOT implemented

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

References operator=().

PPC32InterruptState::~PPC32InterruptState ( )
inline

The destructor

Note
NOT implemented

Definition at line 116 of file ppc32/state.h.

Member Function Documentation

PPC32InterruptState * PPC32InterruptState::construct ( PPC32ProcessorState &  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 200 of file ppc32/state.cc.

uintptr_t PPC32InterruptState::getBasePointer ( ) const
inline

Get the base-pointer

Returns
the base-pointer

Definition at line 230 of file ppc32/state.h.

uintptr_t PPC32InterruptState::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 222 of file ppc32/state.h.

References m_Srr0.

size_t PPC32InterruptState::getInterruptNumber ( ) const
inline

Get the interrupt number

Returns
the interrupt number

Definition at line 246 of file ppc32/state.h.

References m_IntNumber.

processor_register_t PPC32InterruptState::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 106 of file ppc32/state.cc.

References m_Cr, m_Ctr, m_Dar, m_Dsisr, m_Lr, m_R0, m_R1, m_R10, m_R11, m_R12, m_R13, m_R14, m_R15, m_R16, m_R17, m_R18, m_R19, m_R2, m_R20, m_R21, m_R22, m_R23, m_R24, m_R25, m_R26, m_R27, m_R28, m_R29, m_R3, m_R30, m_R31, m_R4, m_R5, m_R6, m_R7, m_R8, m_R9, m_Srr0, m_Srr1, and m_Xer.

size_t PPC32InterruptState::getRegisterCount ( ) const

Get the number of registers

Returns
the number of registers

Definition at line 102 of file ppc32/state.cc.

const char * PPC32InterruptState::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 194 of file ppc32/state.cc.

size_t PPC32InterruptState::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 237 of file ppc32/state.h.

uintptr_t PPC32InterruptState::getStackPointer ( ) const
inline

Get the stack-pointer before the interrupt occured

Returns
the stack-pointer before the interrupt

Definition at line 214 of file ppc32/state.h.

References m_R1.

size_t PPC32InterruptState::getSyscallNumber ( ) const
inline

Get the syscall function number

Returns
the syscall function number

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

References Dec, m_R10, m_R3, m_R6, m_R7, m_R8, m_R9, and WARNING.

size_t PPC32InterruptState::getSyscallService ( ) const
inline

Get the syscall service number

Returns
the syscall service number

Definition at line 251 of file ppc32/state.h.

References m_R3.

bool PPC32InterruptState::kernelMode ( ) const
inline

Did the interrupt happen in kernel-mode?

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

Definition at line 242 of file ppc32/state.h.

References m_Srr1.

PPC32InterruptState & PPC32InterruptState::operator= ( const PPC32InterruptState is)

The assignement operator

Note
NOT implemented

Definition at line 56 of file ppc32/state.cc.

References m_Cr, m_Ctr, m_Dar, m_Dsisr, m_IntNumber, m_Lr, m_R0, m_R1, m_R10, m_R11, m_R12, m_R13, m_R14, m_R15, m_R16, m_R17, m_R18, m_R19, m_R2, m_R20, m_R21, m_R22, m_R23, m_R24, m_R25, m_R26, m_R27, m_R28, m_R29, m_R3, m_R30, m_R31, m_R4, m_R5, m_R6, m_R7, m_R8, m_R9, m_Srr0, m_Srr1, and m_Xer.

Referenced by PPC32InterruptState().

+ Here is the caller graph for this function:

void PPC32InterruptState::setBasePointer ( uintptr_t  basePointer)
inline

Set the base-pointer

Parameters
[in]basePointerthe new base-pointer

Definition at line 234 of file ppc32/state.h.

void PPC32InterruptState::setInstructionPointer ( uintptr_t  instructionPointer)
inline

Set the instruction-pointer

Parameters
[in]instructionPointerthe new instruction-pointer

Definition at line 226 of file ppc32/state.h.

References m_Srr0.

void PPC32InterruptState::setStackPointer ( uintptr_t  stackPointer)
inline

Set the userspace stack-pointer

Parameters
[in]stackPointerthe new stack-pointer

Definition at line 218 of file ppc32/state.h.

References m_R1.

Member Data Documentation

uint32_t PPC32InterruptState::m_Cr

Condition register

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

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

uint32_t PPC32InterruptState::m_Ctr

Loop counter

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

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

uint32_t PPC32InterruptState::m_Dar

DAR - interrupt information - data address register

Definition at line 137 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_Dsisr

DSISR - interrupt information

Definition at line 135 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_IntNumber

The interrupt/exception number.

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

Referenced by getInterruptNumber(), and operator=().

uint32_t PPC32InterruptState::m_Lr

Link register

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

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

uint32_t PPC32InterruptState::m_R0

General purpose register 0

Definition at line 139 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R1

General purpose register 1

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

Referenced by getRegister(), getStackPointer(), operator=(), and setStackPointer().

uint32_t PPC32InterruptState::m_R10

General purpose register 10

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

Referenced by getRegister(), getSyscallNumber(), and operator=().

uint32_t PPC32InterruptState::m_R11

General purpose register 11

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

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

uint32_t PPC32InterruptState::m_R12

General purpose register 12

Definition at line 163 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R13

General purpose register 13

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

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

uint32_t PPC32InterruptState::m_R14

General purpose register 14

Definition at line 167 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R15

General purpose register 15

Definition at line 169 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R16

General purpose register 16

Definition at line 171 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R17

General purpose register 17

Definition at line 173 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R18

General purpose register 18

Definition at line 175 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R19

General purpose register 19

Definition at line 177 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R2

General purpose register 2

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

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

uint32_t PPC32InterruptState::m_R20

General purpose register 20

Definition at line 179 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R21

General purpose register 21

Definition at line 181 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R22

General purpose register 22

Definition at line 183 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R23

General purpose register 23

Definition at line 185 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R24

General purpose register 24

Definition at line 187 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R25

General purpose register 25

Definition at line 189 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R26

General purpose register 26

Definition at line 191 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R27

General purpose register 27

Definition at line 193 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R28

General purpose register 28

Definition at line 195 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R29

General purpose register 29

Definition at line 197 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R3

General purpose register 3

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

Referenced by getRegister(), getSyscallNumber(), getSyscallService(), and operator=().

uint32_t PPC32InterruptState::m_R30

General purpose register 30

Definition at line 199 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R31

General purpose register 31

Definition at line 201 of file ppc32/state.h.

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

uint32_t PPC32InterruptState::m_R4

General purpose register 4

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

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

uint32_t PPC32InterruptState::m_R5

General purpose register 5

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

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

uint32_t PPC32InterruptState::m_R6

General purpose register 6

Definition at line 151 of file ppc32/state.h.

Referenced by getRegister(), getSyscallNumber(), and operator=().

uint32_t PPC32InterruptState::m_R7

General purpose register 7

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

Referenced by getRegister(), getSyscallNumber(), and operator=().

uint32_t PPC32InterruptState::m_R8

General purpose register 8

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

Referenced by getRegister(), getSyscallNumber(), and operator=().

uint32_t PPC32InterruptState::m_R9

General purpose register 9

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

Referenced by getRegister(), getSyscallNumber(), and operator=().

uint32_t PPC32InterruptState::m_Srr0

SRR0 - Contains next program counter location

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

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

uint32_t PPC32InterruptState::m_Srr1

SRR1 - Contains most of the bits from the MSR register

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

Referenced by getRegister(), kernelMode(), and operator=().

uint32_t PPC32InterruptState::m_Xer

Fixed point exception register

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

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


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