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

#include <rex/kernel/object/kernel_object.h>

Public Member Functions

template<typename T, typename... Args>
 KernelObject (std::in_place_type_t< T > tag, Args &&... args)
 ~KernelObject ()
ObjectType GetType () const

Public Attributes

ObjectData data
std::string name
std::vector< X_HANDLE > handles
bool header_hold = false
u32 pointer_refs = 0
u32 guest_ptr = 0
bool owns_guest_block = false
std::atomic< bool > reinit_pending {false}
kernel::GuestAddressSpace * memory = nullptr
WorkspaceHeap * workspace = nullptr
PinCount pins
void(*) destroy (KernelObject *object) noexcept = nullptr

Detailed Description

A kernel object, owned by the table and shared by its handles.

Constructor & Destructor Documentation

◆ KernelObject()

template<typename T, typename... Args>
rex::kernel::KernelObject::KernelObject ( std::in_place_type_t< T > tag,
Args &&... args )
inlineexplicit

Constructs the object around an alternative of ObjectData.

Template Parameters
TThe alternative of ObjectData to construct.
Parameters
tagSelects T.

◆ ~KernelObject()

rex::kernel::KernelObject::~KernelObject ( )

Frees the guest block the object owns.

Member Data Documentation

◆ destroy

void(*) rex::kernel::KernelObject::destroy(KernelObject *object) noexcept = nullptr
noexcept

Frees the object. The owning table sets it.

◆ guest_ptr

u32 rex::kernel::KernelObject::guest_ptr = 0

Address of the object body, 0 without a guest block.

◆ handles

std::vector<X_HANDLE> rex::kernel::KernelObject::handles

One entry per open, in the order opened.

◆ header_hold

bool rex::kernel::KernelObject::header_hold = false

Held by ResolveObject until ForgetAddress, like a handle.

◆ name

std::string rex::kernel::KernelObject::name

Empty for an unnamed object.

◆ owns_guest_block

bool rex::kernel::KernelObject::owns_guest_block = false

True when the destructor frees the block at guest_ptr.

◆ pins

PinCount rex::kernel::KernelObject::pins

Keeps the object alive while a caller uses it.

◆ pointer_refs

u32 rex::kernel::KernelObject::pointer_refs = 0

Pointer references, which keep the object without a handle.

◆ reinit_pending

std::atomic<bool> rex::kernel::KernelObject::reinit_pending {false}

Set when a Ke initializer rewrote the header of an object that owns its block.

◆ workspace

WorkspaceHeap* rex::kernel::KernelObject::workspace = nullptr

Null for the system heap.


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