12#include "dawn/porting/config.hxx"
24#if CONFIG_DAWN_DESC_SLOTS > 1
25 constexpr static size_t SLOT_SIZE = CONFIG_DAWN_DESC_SLOT_SIZE;
27 constexpr static size_t SLOT_SIZE = 0;
32 struct descriptor_reg_s
46 if (CDevDescriptor::singleton ==
nullptr)
51 return CDevDescriptor::singleton;
58 delete CDevDescriptor::singleton;
59 CDevDescriptor::singleton =
nullptr;
92 int writeSlotData(
int inst,
const void *data,
size_t offset,
size_t len);
123#if CONFIG_DAWN_DESC_SLOTS > 1
126 std::array<std::array<uint8_t, SLOT_SIZE>, CONFIG_DAWN_DESC_SLOTS - 1> slotBuf = {};
130 std::array<size_t, CONFIG_DAWN_DESC_SLOTS - 1> slotWritten = {};
135 CDevDescriptor() =
default;
Descriptor interface available for IO.
static void destroy()
Destroy singleton instance.
int resetSlot(int inst)
Reset a RAM slot.
int getDescriptor(int inst, SDescriptorReg ®)
Get registered descriptor data for an instance.
static CDevDescriptor * getInst()
Get singleton instance.
int regDescriptor(int inst, const SDescriptorReg ®)
Register descriptor data for an instance.
int writeSlotData(int inst, const void *data, size_t offset, size_t len)
Write descriptor bytes into a RAM slot.
static int MAX_DESCRIPTORS
Maximum number of descriptors that can be registered.
size_t getSlotWritten(int inst) const
Get valid byte count currently stored in a RAM slot.
Out-of-tree user-extension hooks for Dawn.
Registered descriptor information.
size_t len
Descriptor length in bytes.
void * ptr
Pointer to descriptor data.