ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::ThreadState Class Reference

Public Member Functions

 ThreadState (u32 thread_id, u32 stack_base, u32 pcr_address, GuestAddressSpace *memory, TitleRuntime *runtime)
 ~ThreadState ()
GuestAddressSpace * GetAddressSpace () const
void RequestStop ()
bool IsStopRequested () const
void ClearStop ()
::PPCContext * GetContext () const
u32 GetThreadID () const
TitleRuntime * GetRuntime () const
DPCSaveArea & GetDPCSaveArea ()
char *& GetStrtokContext ()

Static Public Member Functions

static void Bind (ThreadState *state)
static ThreadState * Get ()
static u32 GetBoundThreadID ()

Constructor & Destructor Documentation

◆ ThreadState()

rex::kernel::ThreadState::ThreadState ( u32 thread_id,
u32 stack_base,
u32 pcr_address,
GuestAddressSpace * memory,
TitleRuntime * runtime )

Constructs the state of a guest thread.

Parameters
thread_idThe guest thread ID, UINT32_MAX for a host thread ID.
stack_baseThe guest stack pointer.
pcr_addressThe guest PCR address, loaded into r13.
runtimeThe runtime the thread belongs to, null in tests that run without one.

◆ ~ThreadState()

rex::kernel::ThreadState::~ThreadState ( )

Unbinds the state from the calling host thread when it is the bound one.

Member Function Documentation

◆ Bind()

void rex::kernel::ThreadState::Bind ( ThreadState * state)
static

Binds a thread state to the calling host thread.

Parameters
stateThe state, null to unbind.

◆ ClearStop()

void rex::kernel::ThreadState::ClearStop ( )
inline

Clears the stop request once the thread runs its exit sequence.

◆ Get()

ThreadState * rex::kernel::ThreadState::Get ( )
static

Returns the thread state bound to the calling host thread, null when none is bound.

◆ GetBoundThreadID()

u32 rex::kernel::ThreadState::GetBoundThreadID ( )
static
Returns
The ID, 0xFFFFFFFF when none is bound.

◆ GetRuntime()

TitleRuntime * rex::kernel::ThreadState::GetRuntime ( ) const
inline

Returns the runtime the thread belongs to, null for a state built without one.

◆ GetStrtokContext()

char *& rex::kernel::ThreadState::GetStrtokContext ( )
inline

Returns the scan position of the shim strtok on this thread.

◆ RequestStop()

void rex::kernel::ThreadState::RequestStop ( )
inline

Asks the thread to stop at its next kernel boundary.


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