|
Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
|
Caller-owned ThreadX task, wait and byte queue services. More...
Go to the source code of this file.
Data Structures | |
| struct | nx_threadx_notify_t |
| One binary latch; publishers quiesce before destruction. More... | |
| struct | nx_threadx_task_t |
| Returning task retains all storage until external successful join. More... | |
| struct | nx_threadx_permanent_task_t |
| Permanent task has no completion latch, join or destroy. More... | |
| struct | nx_threadx_queue_t |
| Exact arbitrary byte items; no native word-size narrowing. More... | |
| struct | nx_threadx_queue_waiter |
| One explicit caller latch per simultaneous close-aware operation. More... | |
| struct | nx_threadx_closable_queue_t |
| Optional bounded close broadcast; registry is task-only. More... | |
Typedefs | |
| typedef struct nx_threadx_queue_waiter | nx_threadx_queue_waiter_t |
| One explicit caller latch per simultaneous close-aware operation. | |
Functions | |
| nx_result_t | nx_threadx_kernel_enter (void(*startup)(void *), void *context) |
| Explicit irreversible kernel entry owned by the product. | |
| void | nx_threadx_fail_stop (nx_result_t reason) |
| Product failure hook; default parks forever. | |
| nx_result_t | nx_threadx_external_tick_setup (uint32_t tick_hz) |
| Mandatory product hook only for explicit external Tick. | |
| bool | nx_threadx_isr_allowed (void) |
| Read-only configurable-IRQ and selected mask-policy gate. | |
| nx_result_t | nx_threadx_notify_init (nx_threadx_notify_t *notification) |
| Initialize one binary latch in task or actual bootstrap. | |
| nx_wait_port_t | nx_threadx_notify_port (nx_threadx_notify_t *notification) |
| Bind a sequence hint and one concurrent blocking waiter. | |
| nx_result_t | nx_threadx_notify_destroy (nx_threadx_notify_t *notification) |
| Destroy only after all publishers and waiter quiesce. | |
| nx_result_t | nx_threadx_task_start (nx_threadx_task_t *task, const char *name, void *stack, size_t stack_bytes, UINT priority, void(*entry)(void *), void *context) |
| Create a cooperatively returning task using exact storage. | |
| nx_result_t | nx_threadx_task_join (nx_threadx_task_t *task, nx_time_us_t deadline) |
| Join a cooperatively returned task and prove detachment. | |
| nx_result_t | nx_threadx_task_discard_before_scheduler (nx_threadx_task_t *task) |
| Discard an unused task only inside actual bootstrap. | |
| nx_result_t | nx_threadx_permanent_task_start (nx_threadx_permanent_task_t *task, const char *name, void *stack, size_t stack_bytes, UINT priority, void(*entry)(void *), void *context) |
| Start a permanent task without a completion latch. | |
| nx_result_t | nx_threadx_queue_init (nx_threadx_queue_t *queue, uint8_t *storage, size_t storage_bytes, size_t depth, size_t item_size) |
| Initialize an exact arbitrary-byte bounded queue. | |
| nx_result_t | nx_threadx_queue_send_until (nx_threadx_queue_t *queue, const void *item, nx_time_us_t deadline) |
| Task-only send; immediate readiness wins over expiration. | |
| nx_result_t | nx_threadx_queue_receive_until (nx_threadx_queue_t *queue, void *item, nx_time_us_t deadline) |
| Task-only receive; output changes only on SUCCESS. | |
| nx_result_t | nx_threadx_queue_destroy (nx_threadx_queue_t *queue) |
| Destroy a drained queue after every caller quiesces. | |
| nx_result_t | nx_threadx_queue_waiter_init (nx_threadx_queue_waiter_t *waiter) |
| Initialize one explicit close-aware operation latch. | |
| nx_result_t | nx_threadx_queue_waiter_destroy (nx_threadx_queue_waiter_t *waiter) |
| Destroy inactive waiter after its operation has returned. | |
| nx_result_t | nx_threadx_closable_queue_init (nx_threadx_closable_queue_t *queue, uint8_t *storage, size_t storage_bytes, size_t depth, size_t item_size, size_t maximum_waiters) |
| Add explicit bounded close broadcast to a byte queue. | |
| nx_result_t | nx_threadx_closable_queue_close (nx_threadx_closable_queue_t *queue) |
| Reject sends, wake registered waiters, retain queued items. | |
| nx_result_t | nx_threadx_closable_queue_send_until (nx_threadx_closable_queue_t *queue, const void *item, nx_time_us_t deadline, nx_threadx_queue_waiter_t *waiter) |
| Send with immediate close wake and explicit admission. | |
| nx_result_t | nx_threadx_closable_queue_receive_until (nx_threadx_closable_queue_t *queue, void *item, nx_time_us_t deadline, nx_threadx_queue_waiter_t *waiter) |
| Receive and drain previously queued items after close. | |
| nx_result_t | nx_threadx_closable_queue_destroy (nx_threadx_closable_queue_t *queue) |
| Destroy only a closed, drained and quiesced queue. | |
Caller-owned ThreadX task, wait and byte queue services.
Definition in file threadx.h.
| typedef struct nx_threadx_queue_waiter nx_threadx_queue_waiter_t |
One explicit caller latch per simultaneous close-aware operation.
| nx_result_t nx_threadx_closable_queue_close | ( | nx_threadx_closable_queue_t * | queue | ) |
Reject sends, wake registered waiters, retain queued items.
| [in,out] | queue | Live close-aware queue |
| nx_result_t nx_threadx_closable_queue_destroy | ( | nx_threadx_closable_queue_t * | queue | ) |
Destroy only a closed, drained and quiesced queue.
| [in,out] | queue | Live control and its borrowed payload storage |
| nx_result_t nx_threadx_closable_queue_init | ( | nx_threadx_closable_queue_t * | queue, |
| uint8_t * | storage, | ||
| size_t | storage_bytes, | ||
| size_t | depth, | ||
| size_t | item_size, | ||
| size_t | maximum_waiters ) |
Add explicit bounded close broadcast to a byte queue.
| [in,out] | queue | Zeroed caller control retained until destroy |
| [in] | storage | Caller payload storage retained until destroy |
| [in] | storage_bytes | Exact depth multiplied by item_size |
| [in] | depth | Positive capacity below TX_WAIT_FOREVER |
| [in] | item_size | Positive exact payload byte count |
| [in] | maximum_waiters | Positive maximum simultaneous operations |
| nx_result_t nx_threadx_closable_queue_receive_until | ( | nx_threadx_closable_queue_t * | queue, |
| void * | item, | ||
| nx_time_us_t | deadline, | ||
| nx_threadx_queue_waiter_t * | waiter ) |
Receive and drain previously queued items after close.
| [in,out] | queue | Live queue retained throughout the operation |
| [out] | item | Exactly item_size writable bytes borrowed until return |
| [in] | deadline | Absolute Core deadline or NX_DEADLINE_NEVER |
| [in,out] | waiter | Live exclusive latch for this simultaneous call |
| nx_result_t nx_threadx_closable_queue_send_until | ( | nx_threadx_closable_queue_t * | queue, |
| const void * | item, | ||
| nx_time_us_t | deadline, | ||
| nx_threadx_queue_waiter_t * | waiter ) |
Send with immediate close wake and explicit admission.
| [in,out] | queue | Live queue retained throughout the operation |
| [in] | item | Exactly item_size readable bytes borrowed until return |
| [in] | deadline | Absolute Core deadline or NX_DEADLINE_NEVER |
| [in,out] | waiter | Live exclusive latch for this simultaneous call |
| nx_result_t nx_threadx_external_tick_setup | ( | uint32_t | tick_hz | ) |
Mandatory product hook only for explicit external Tick.
| [in] | tick_hz | Exact immutable resolved kernel frequency |
| void nx_threadx_fail_stop | ( | nx_result_t | reason | ) |
Product failure hook; default parks forever.
| [in] | reason | Context, permanent-entry or kernel-return failure |
| bool nx_threadx_isr_allowed | ( | void | ) |
Read-only configurable-IRQ and selected mask-policy gate.
| nx_result_t nx_threadx_kernel_enter | ( | void(* | startup )(void *), |
| void * | context ) |
Explicit irreversible kernel entry owned by the product.
| [in] | startup | Product initialization inside tx_application_define |
| [in] | context | Borrowed through startup and kernel lifetime |
| nx_result_t nx_threadx_notify_destroy | ( | nx_threadx_notify_t * | notification | ) |
Destroy only after all publishers and waiter quiesce.
| [in,out] | notification | Live caller latch |
| nx_result_t nx_threadx_notify_init | ( | nx_threadx_notify_t * | notification | ) |
Initialize one binary latch in task or actual bootstrap.
| [in,out] | notification | Zeroed caller control retained until destroy |
| nx_wait_port_t nx_threadx_notify_port | ( | nx_threadx_notify_t * | notification | ) |
Bind a sequence hint and one concurrent blocking waiter.
| [in,out] | notification | Live latch retained through every port user |
| nx_result_t nx_threadx_permanent_task_start | ( | nx_threadx_permanent_task_t * | task, |
| const char * | name, | ||
| void * | stack, | ||
| size_t | stack_bytes, | ||
| UINT | priority, | ||
| void(* | entry )(void *), | ||
| void * | context ) |
Start a permanent task without a completion latch.
| [in,out] | task | Zeroed caller control, retained until reset |
| [in] | name | Borrowed immutable name, retained until reset |
| [in] | stack | Aligned caller buffer, retained until reset |
| [in] | stack_bytes | Actual capacity, at least TX_MINIMUM_STACK |
| [in] | priority | Smaller ThreadX priority values run first |
| [in] | entry | Never returns; return invokes retaining fail-stop |
| [in] | context | Borrowed until reset |
| nx_result_t nx_threadx_queue_destroy | ( | nx_threadx_queue_t * | queue | ) |
Destroy a drained queue after every caller quiesces.
| [in,out] | queue | Live caller control and storage |
| nx_result_t nx_threadx_queue_init | ( | nx_threadx_queue_t * | queue, |
| uint8_t * | storage, | ||
| size_t | storage_bytes, | ||
| size_t | depth, | ||
| size_t | item_size ) |
Initialize an exact arbitrary-byte bounded queue.
| [in,out] | queue | Zeroed caller control retained until destroy |
| [in] | storage | Caller payload storage retained until destroy |
| [in] | storage_bytes | Exact depth multiplied by item_size |
| [in] | depth | Positive bounded capacity, below TX_WAIT_FOREVER |
| [in] | item_size | Positive byte count, without word-size narrowing |
| nx_result_t nx_threadx_queue_receive_until | ( | nx_threadx_queue_t * | queue, |
| void * | item, | ||
| nx_time_us_t | deadline ) |
Task-only receive; output changes only on SUCCESS.
| [in,out] | queue | Live queue retained throughout the operation |
| [out] | item | Exactly item_size writable bytes borrowed until return |
| [in] | deadline | Absolute Core deadline or NX_DEADLINE_NEVER |
| nx_result_t nx_threadx_queue_send_until | ( | nx_threadx_queue_t * | queue, |
| const void * | item, | ||
| nx_time_us_t | deadline ) |
Task-only send; immediate readiness wins over expiration.
| [in,out] | queue | Live queue retained throughout the operation |
| [in] | item | Exactly item_size readable bytes borrowed until return |
| [in] | deadline | Absolute Core deadline or NX_DEADLINE_NEVER |
| nx_result_t nx_threadx_queue_waiter_destroy | ( | nx_threadx_queue_waiter_t * | waiter | ) |
Destroy inactive waiter after its operation has returned.
| [in,out] | waiter | Live caller latch with no concurrent users |
| nx_result_t nx_threadx_queue_waiter_init | ( | nx_threadx_queue_waiter_t * | waiter | ) |
Initialize one explicit close-aware operation latch.
| [in,out] | waiter | Zeroed caller storage retained until waiter destroy |
| nx_result_t nx_threadx_task_discard_before_scheduler | ( | nx_threadx_task_t * | task | ) |
Discard an unused task only inside actual bootstrap.
| [in,out] | task | Live task whose entry has never begun |
| nx_result_t nx_threadx_task_join | ( | nx_threadx_task_t * | task, |
| nx_time_us_t | deadline ) |
Join a cooperatively returned task and prove detachment.
| [in,out] | task | Live caller task, one external joiner only |
| [in] | deadline | Absolute Core deadline or NX_DEADLINE_NEVER |
| nx_result_t nx_threadx_task_start | ( | nx_threadx_task_t * | task, |
| const char * | name, | ||
| void * | stack, | ||
| size_t | stack_bytes, | ||
| UINT | priority, | ||
| void(* | entry )(void *), | ||
| void * | context ) |
Create a cooperatively returning task using exact storage.
| [in,out] | task | Zeroed caller TCB/control, retained until join/discard |
| [in] | name | Borrowed immutable name, retained until reclamation |
| [in] | stack | Eight-byte aligned caller storage |
| [in] | stack_bytes | Actual capacity, at least TX_MINIMUM_STACK |
| [in] | priority | ThreadX priority; smaller values run first |
| [in] | entry | Returns only after application stop/drain |
| [in] | context | Borrowed until successful join/discard |