ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_esp_hosted_rtos_internal.h
Go to the documentation of this file.
1
53
54#pragma once
55
56#include <stddef.h>
57#include <stdint.h>
58
59#include "esp_hosted_os_abstraction.h"
60#include "ra8_attributes.h"
61#include "ra8_err.h"
62
63/* ----------------------------------------------------------------------- */
64/* Lifecycle */
65/* ----------------------------------------------------------------------- */
66
113
151
179RA8_PRIV [[nodiscard]] bool priv_ra8_esp_hosted_rtos_is_ready(void);
180
212RA8_PRIV void priv_ra8_esp_hosted_rtos_pool_stats(uint32_t* out_available, uint32_t* out_fragments);
213
249RA8_PRIV ra8_err_t priv_ra8_esp_hosted_rtos_bind(hosted_osi_funcs_t* out);
250
281
313
342
372
373/* ----------------------------------------------------------------------- */
374/* Fixed-table helpers */
375/* ----------------------------------------------------------------------- */
376
416RA8_PRIV [[nodiscard]] uint32_t priv_ra8_esp_hosted_rtos_slot_take(bool* used, uint32_t count);
417
465RA8_PRIV [[nodiscard]] uint32_t priv_ra8_esp_hosted_rtos_slot_index(const void* handle,
466 const void* base,
467 size_t stride,
468 uint32_t count,
469 const bool* used);
470
500
531
532/* ----------------------------------------------------------------------- */
533/* Testable arithmetic */
534/* ----------------------------------------------------------------------- */
535
584RA8_PRIV [[nodiscard]] uint32_t priv_ra8_esp_hosted_rtos_ms_to_ticks(int timeout_ms);
585
631RA8_PRIV [[nodiscard]] uint32_t priv_ra8_esp_hosted_rtos_queue_words(uint32_t item_bytes);
632
683RA8_PRIV [[nodiscard]] uint32_t priv_ra8_esp_hosted_rtos_us_spin_iters(uint32_t cpu_hz,
684 uint32_t usec);
685
686/* ----------------------------------------------------------------------- */
687/* Fixed-storage allocator */
688/* ----------------------------------------------------------------------- */
689
749RA8_PRIV [[nodiscard]] void* priv_ra8_esp_hosted_rtos_alloc(size_t size, size_t align);
750
789
823RA8_PRIV ra8_err_t priv_ra8_esp_hosted_rtos_block_size(const void* ptr, size_t* out_size);
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t priv_ra8_esp_hosted_rtos_deinit(void)
Tear the RTOS substrate down, deleting every outstanding object.
ra8_err_t priv_ra8_esp_hosted_rtos_sync_deinit(void)
Delete every outstanding mutex and semaphore.
ra8_err_t priv_ra8_esp_hosted_rtos_release(void *ptr)
Release a block obtained from priv_ra8_esp_hosted_rtos_alloc.
ra8_err_t priv_ra8_esp_hosted_rtos_block_size(const void *ptr, size_t *out_size)
Read back the payload size recorded for an allocated block.
uint32_t priv_ra8_esp_hosted_rtos_ms_to_ticks(int timeout_ms)
Convert an esp-hosted millisecond timeout to a ThreadX wait option.
ra8_err_t priv_ra8_esp_hosted_rtos_bind(hosted_osi_funcs_t *out)
Populate the thread, sleep, timer and clock slots of the vtable.
ra8_err_t priv_ra8_esp_hosted_rtos_sync_init(void)
Clear the mutex and semaphore tables and mark them usable.
uint32_t priv_ra8_esp_hosted_rtos_us_spin_iters(uint32_t cpu_hz, uint32_t usec)
Size the busy-wait loop that stands in for a microsecond delay.
bool priv_ra8_esp_hosted_rtos_is_ready(void)
Report whether the RTOS substrate is currently initialised.
ra8_err_t priv_ra8_esp_hosted_rtos_init(void)
Bring the RTOS substrate up: byte pools and empty object tables.
ra8_err_t priv_ra8_esp_hosted_rtos_bind_sync(hosted_osi_funcs_t *out)
Populate the mutex and semaphore slots of the vtable.
uint32_t priv_ra8_esp_hosted_rtos_slot_take(bool *used, uint32_t count)
Claim the first free row of an occupancy bitmap.
ra8_err_t priv_ra8_esp_hosted_rtos_pool_init(void)
Create the two byte pools over their static backing arrays.
uint32_t priv_ra8_esp_hosted_rtos_queue_words(uint32_t item_bytes)
Round an esp-hosted queue element size up to whole ThreadX words.
ra8_err_t priv_ra8_esp_hosted_rtos_bind_pool(hosted_osi_funcs_t *out)
Populate the memory and queue slots of the vtable.
ra8_err_t priv_ra8_esp_hosted_rtos_pool_deinit(void)
Destroy every queue and both byte pools.
uint32_t priv_ra8_esp_hosted_rtos_slot_index(const void *handle, const void *base, size_t stride, uint32_t count, const bool *used)
Resolve an opaque handle to its row index in a fixed table.
void * priv_ra8_esp_hosted_rtos_alloc(size_t size, size_t align)
Allocate an aligned block from the transport byte pool.
void priv_ra8_esp_hosted_rtos_pool_stats(uint32_t *out_available, uint32_t *out_fragments)
Read live transport-pool occupancy.