ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_wdt_sup_tx_shim_internal.h File Reference

ThreadX shim for ra8_wdt_supervisor (host unit-test build only). More...

#include <stdint.h>
#include "ra8_attributes.h"
Include dependency graph for ra8_wdt_sup_tx_shim_internal.h:

Go to the source code of this file.

Data Structures

struct  TX_MUTEX
 Opaque mutex stand-in for the host build. More...
struct  TX_THREAD
 Opaque thread stand-in for the host build. More...

Macros

#define tx_mutex_create   internal_tx_mutex_create
#define tx_mutex_get   internal_tx_mutex_get
#define tx_mutex_put   internal_tx_mutex_put
#define tx_mutex_delete   internal_tx_mutex_delete
#define tx_thread_create   internal_tx_thread_create
#define tx_thread_terminate   internal_tx_thread_terminate
#define tx_thread_delete   internal_tx_thread_delete
#define tx_thread_sleep   internal_tx_thread_sleep
#define tx_time_get   internal_tx_time_get
#define TX_SUCCESS   (0U)
#define TX_NO_INHERIT   (0U)
#define TX_WAIT_FOREVER   (0xFFFFFFFFUL)
#define TX_AUTO_START   (1U)
#define TX_NO_TIME_SLICE   (0U)

Typedefs

typedef unsigned long ULONG
 ThreadX-compatible unsigned long (host stub).
typedef unsigned int UINT
 ThreadX-compatible unsigned int (host stub).
typedef char CHAR
 ThreadX-compatible CHAR (host stub).

Enumerations

enum  ra8_wdt_sup_tx_shim_canary_t : uint32_t {
  k_ra8_wdt_sup_tx_shim_mutex_canary = 0xA5A5A5A5U ,
  k_ra8_wdt_sup_tx_shim_thread_canary
}
 Canary patterns stamped into host-stub TX_MUTEX / TX_THREAD blocks. More...

Functions

static UINT internal_tx_mutex_create (TX_MUTEX *m, CHAR *name, UINT inherit)
 Host stub for tx_mutex_create.
static UINT internal_tx_mutex_get (TX_MUTEX *m, ULONG wait)
 Host stub for tx_mutex_get.
static UINT internal_tx_mutex_put (TX_MUTEX *m)
 Host stub for tx_mutex_put.
static UINT internal_tx_mutex_delete (TX_MUTEX *m)
 Host stub for tx_mutex_delete.
static UINT internal_tx_thread_create (TX_THREAD *t, CHAR *name, void(*entry)(ULONG), ULONG arg, void *stack, ULONG stack_size, UINT prio, UINT preempt_thresh, UINT slice, UINT autostart)
 Host stub for tx_thread_create.
static UINT internal_tx_thread_terminate (TX_THREAD *t)
 Host stub for tx_thread_terminate.
static UINT internal_tx_thread_delete (TX_THREAD *t)
 Host stub for tx_thread_delete.
static UINT internal_tx_thread_sleep (ULONG ticks)
 Host stub for tx_thread_sleep.
static ULONG internal_tx_time_get (void)
 Host stub for tx_time_get.

Detailed Description

ThreadX shim for ra8_wdt_supervisor (host unit-test build only).

Tag
[Ring 4 / Service] {World: NS}

On the cross-compiled target, the supervisor pulls in the real tx_api.h. On the host unit-test build (RA8_OFF_TARGET) ThreadX is not linked, so this header provides degenerate stand-ins for the handful of TX symbols the supervisor uses. The stubs let the implementation file compile and link unchanged; tests drive the supervisor synchronously through ra8_wdt_supervisor_tick.

Definition in file ra8_wdt_sup_tx_shim_internal.h.

Macro Definition Documentation

◆ TX_AUTO_START

◆ tx_mutex_create

◆ tx_mutex_delete

#define tx_mutex_delete   internal_tx_mutex_delete

◆ tx_mutex_get

◆ tx_mutex_put

◆ TX_NO_INHERIT

#define TX_NO_INHERIT   (0U)

◆ TX_NO_TIME_SLICE

◆ TX_SUCCESS

#define TX_SUCCESS   (0U)

Definition at line 83 of file ra8_wdt_sup_tx_shim_internal.h.

Referenced by ble_npl_callout_is_active(), ble_npl_callout_reset(), ble_npl_eventq_get(), ble_npl_eventq_is_empty(), ble_npl_mutex_init(), ble_npl_mutex_pend(), ble_npl_mutex_release(), ble_npl_sem_init(), ble_npl_sem_pend(), ble_npl_sem_release(), demo_calloc(), internal_demo_calloc(), internal_h_create_mutex(), internal_h_create_queue(), internal_h_create_semaphore(), internal_h_dequeue_item(), internal_h_destroy_mutex(), internal_h_destroy_queue(), internal_h_destroy_semaphore(), internal_h_get_semaphore(), internal_h_lock_mutex(), internal_h_post_semaphore(), internal_h_post_semaphore_from_isr(), internal_h_queue_item(), internal_h_reset_queue(), internal_h_thread_cancel(), internal_h_thread_create(), internal_h_timer_start(), internal_h_timer_stop(), internal_h_unlock_mutex(), internal_spawn_rx_worker(), internal_spawn_rx_worker(), internal_timer_arm(), internal_timer_disarm(), internal_tx_mutex_create(), internal_tx_mutex_delete(), internal_tx_mutex_get(), internal_tx_mutex_put(), internal_tx_thread_create(), internal_tx_thread_delete(), internal_tx_thread_sleep(), internal_tx_thread_terminate(), internal_wait_completion(), ipc_consumer_thread_entry(), ipc_producer_thread_entry(), nx_ether_driver_c6_bind(), priv_ra8_esp_hosted_rtos_alloc(), priv_ra8_esp_hosted_rtos_pool_deinit(), priv_ra8_esp_hosted_rtos_pool_init(), priv_ra8_esp_hosted_rtos_release(), ra8_wdt_supervisor_checkin(), ra8_wdt_supervisor_init(), ra8_wdt_supervisor_register_thread(), ra8_wdt_supervisor_start(), ra8_wdt_supervisor_tick(), tx_application_define(), and wdt_sup_demo_spawn_workers().

◆ tx_thread_create

◆ tx_thread_delete

#define tx_thread_delete   internal_tx_thread_delete

◆ tx_thread_sleep

#define tx_thread_sleep   internal_tx_thread_sleep

◆ tx_thread_terminate

#define tx_thread_terminate   internal_tx_thread_terminate

◆ tx_time_get

◆ TX_WAIT_FOREVER

Typedef Documentation

◆ CHAR

typedef char CHAR

ThreadX-compatible CHAR (host stub).

Definition at line 80 of file ra8_wdt_sup_tx_shim_internal.h.

◆ UINT

typedef unsigned int UINT

ThreadX-compatible unsigned int (host stub).

Definition at line 74 of file ra8_wdt_sup_tx_shim_internal.h.

◆ ULONG

typedef unsigned long ULONG

ThreadX-compatible unsigned long (host stub).

Definition at line 68 of file ra8_wdt_sup_tx_shim_internal.h.

Enumeration Type Documentation

◆ ra8_wdt_sup_tx_shim_canary_t

Canary patterns stamped into host-stub TX_MUTEX / TX_THREAD blocks.

The host shim does not implement real ThreadX semantics; it only needs a way to mark a control block as "created" so unit tests that introspect the structures can tell the difference. Two distinct canaries are used so a stray pointer pun between mutex and thread is detectable. Per CLAUDE.md no integer literals are allowed in source files – these are named typed enums.

Enumerator
k_ra8_wdt_sup_tx_shim_mutex_canary 

Stamped into TX_MUTEX::magic on create.

k_ra8_wdt_sup_tx_shim_thread_canary 

Stamped into TX_THREAD::magic on create.

Definition at line 105 of file ra8_wdt_sup_tx_shim_internal.h.

Function Documentation

◆ internal_tx_mutex_create()

UINT internal_tx_mutex_create ( TX_MUTEX * m,
CHAR * name,
UINT inherit )
inlinestatic

Host stub for tx_mutex_create.

See implementation.

Parameters
[in]mSee implementation.
[in]nameSee implementation.
[in]inheritSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 144 of file ra8_wdt_sup_tx_shim_internal.h.

References k_ra8_wdt_sup_tx_shim_mutex_canary, TX_MUTEX::magic, RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_mutex_delete()

UINT internal_tx_mutex_delete ( TX_MUTEX * m)
inlinestatic

Host stub for tx_mutex_delete.

See implementation.

Parameters
[in]mSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 211 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_mutex_get()

UINT internal_tx_mutex_get ( TX_MUTEX * m,
ULONG wait )
inlinestatic

Host stub for tx_mutex_get.

See implementation.

Parameters
[in]mSee implementation.
[in]waitSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 170 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_mutex_put()

UINT internal_tx_mutex_put ( TX_MUTEX * m)
inlinestatic

Host stub for tx_mutex_put.

See implementation.

Parameters
[in]mSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 191 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_thread_create()

UINT internal_tx_thread_create ( TX_THREAD * t,
CHAR * name,
void(* entry )(ULONG),
ULONG arg,
void * stack,
ULONG stack_size,
UINT prio,
UINT preempt_thresh,
UINT slice,
UINT autostart )
inlinestatic

Host stub for tx_thread_create.

See implementation.

Parameters
[in]tSee implementation.
[in]nameSee implementation.
[in]entrySee implementation.
[in]argSee implementation.
[in]stackSee implementation.
[in]stack_sizeSee implementation.
[in]prioSee implementation.
[in]preempt_threshSee implementation.
[in]sliceSee implementation.
[in]autostartSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 241 of file ra8_wdt_sup_tx_shim_internal.h.

References k_ra8_wdt_sup_tx_shim_thread_canary, TX_THREAD::magic, RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_thread_delete()

UINT internal_tx_thread_delete ( TX_THREAD * t)
inlinestatic

Host stub for tx_thread_delete.

See implementation.

Parameters
[in]tSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 302 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_thread_sleep()

UINT internal_tx_thread_sleep ( ULONG ticks)
inlinestatic

Host stub for tx_thread_sleep.

See implementation.

Parameters
[in]ticksSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 322 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_thread_terminate()

UINT internal_tx_thread_terminate ( TX_THREAD * t)
inlinestatic

Host stub for tx_thread_terminate.

See implementation.

Parameters
[in]tSee implementation.
Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 282 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL, and TX_SUCCESS.

◆ internal_tx_time_get()

ULONG internal_tx_time_get ( void )
inlinestatic

Host stub for tx_time_get.

See implementation.

Returns
Result code.
Return values
k_ra8_okOperation succeeded.
Precondition
Module state is consistent.
Module state is consistent.
Postcondition
Caller-visible state matches the documented contract.
Caller-visible state matches the documented contract.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Definition at line 341 of file ra8_wdt_sup_tx_shim_internal.h.

References RA8_INTERNAL.