ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::TimerObject Struct Reference

Public Member Functions

 TimerObject (u32 timer_type)
 ~TimerObject ()
X_STATUS SetDPC (TitleRuntime &runtime, u32 ktimer, i64 due_time, u32 period_ms, u32 dpc)
X_STATUS Set (TitleRuntime &runtime, i64 due_time, u32 period_ms, u32 routine, u32 routine_arg, bool resume)
X_STATUS Cancel ()

Public Attributes

PublishedPtr< rex::platform::Timer > timer
std::weak_ptr< rex::platform::TimerQueueWaitItem > expiry
u32 callback_thread_id = 0
u32 callback_routine = 0
u32 callback_routine_arg = 0

Constructor & Destructor Documentation

◆ TimerObject()

rex::kernel::TimerObject::TimerObject ( u32 timer_type)
explicit

Constructs a timer of a type.

Parameters
timer_type0 for a notification timer, 1 for a synchronization timer.

◆ ~TimerObject()

rex::kernel::TimerObject::~TimerObject ( )

Disarms the timer.

Member Function Documentation

◆ Cancel()

X_STATUS rex::kernel::TimerObject::Cancel ( )
Returns
X_STATUS_SUCCESS, or X_STATUS_UNSUCCESSFUL.

◆ Set()

X_STATUS rex::kernel::TimerObject::Set ( TitleRuntime & runtime,
i64 due_time,
u32 period_ms,
u32 routine,
u32 routine_arg,
bool resume )

Arms a timer. A completion routine runs as an APC on the calling thread.

Parameters
due_timeA negative relative time in 100 nanosecond ticks, or an absolute file time.
period_msThe repeat period in milliseconds, 0 for a single shot.
routineThe title completion routine, 0 for none.
resumeTrue to request a resume from suspend, which is ignored.
Returns
X_STATUS_SUCCESS, X_STATUS_TIMER_RESUME_IGNORED or X_STATUS_UNSUCCESSFUL.

◆ SetDPC()

X_STATUS rex::kernel::TimerObject::SetDPC ( TitleRuntime & runtime,
u32 ktimer,
i64 due_time,
u32 period_ms,
u32 dpc )

Arms a KTIMER that queues its DPC when it expires.

Parameters
runtimeThe runtime that owns the dispatcher.
ktimerAddress of the title's KTIMER.
due_timeA negative relative time in 100 nanosecond ticks, or an absolute file time.
period_msThe repeat period in milliseconds, 0 for a single shot.
dpcAddress of the title's KDPC, 0 for none.
Returns
X_STATUS_SUCCESS, or X_STATUS_UNSUCCESSFUL.

Member Data Documentation

◆ callback_routine

u32 rex::kernel::TimerObject::callback_routine = 0

Guest address of the completion routine, 0 for none.

◆ callback_thread_id

u32 rex::kernel::TimerObject::callback_thread_id = 0

ID of the thread that armed the timer, the thread its completion routine runs on.

◆ expiry

std::weak_ptr<rex::platform::TimerQueueWaitItem> rex::kernel::TimerObject::expiry

Pending expiry entry the dispatcher tracks, expired when the timer is canceled.

◆ timer

PublishedPtr<rex::platform::Timer> rex::kernel::TimerObject::timer

Host timer that signals the object when it expires.


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