|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Critical sections and interrupt-context detection. More...

Typedefs | |
| typedef uint64_t | ove_irq_key_t |
| Opaque cookie returned by ove_irq_lock for use with ove_irq_unlock. | |
Functions | |
| ove_irq_key_t | ove_irq_lock (void) |
| Enter a critical section: disable interrupts (or equivalent backend mechanism) and return an opaque restore cookie. | |
| void | ove_irq_unlock (ove_irq_key_t key) |
| Leave a critical section, restoring the interrupt state captured by the corresponding ove_irq_lock. | |
| bool | ove_is_in_isr (void) |
| Return true if the caller is currently in interrupt context. | |
Critical sections and interrupt-context detection.
Public primitives used by the async runtime (Embassy on Rust) to implement a critical-section provider and dispatch between thread- and ISR-context paths. The C API itself does not need these for normal blocking-style code — they are wired so that higher-level bindings can layer an async executor on top.
CONFIG_OVE_ASYNC. When CONFIG_OVE_ASYNC is not set, every function is replaced by a static inline stub that returns OVE_ERR_NOT_SUPPORTED (or zero, where the signature precludes an error return). | typedef uint64_t ove_irq_key_t |
Opaque cookie returned by ove_irq_lock for use with ove_irq_unlock.
The width is sized to fit each backend's native restore state:
unsigned int returned by irq_lock().taskENTER_CRITICAL macros are symmetric and don't return a value).irqstate_t (typically uint32_t).uint64_t (a TLS nesting depth — no real ISR-mask).The C ABI commits to uint64_t so the Rust binding's critical-section::Impl::RawRestoreState can be a single fixed size across every target.
| ove_irq_key_t ove_irq_lock | ( | void | ) |
Enter a critical section: disable interrupts (or equivalent backend mechanism) and return an opaque restore cookie.
Safe to call from both thread and ISR context. Nestable — each ove_irq_lock must be paired with a matching ove_irq_unlock passing the same cookie back, in LIFO order. The outermost ove_irq_unlock restores the previous interrupt state.
CONFIG_OVE_ASYNC. | void ove_irq_unlock | ( | ove_irq_key_t | key | ) |
Leave a critical section, restoring the interrupt state captured by the corresponding ove_irq_lock.
| [in] | key | Cookie returned by the matching ove_irq_lock. |
CONFIG_OVE_ASYNC. | bool ove_is_in_isr | ( | void | ) |
Return true if the caller is currently in interrupt context.
Used by higher-level bindings (Rust async runtime) to dispatch between the thread-context and ISR-context variants of a wake primitive (e.g. ove_event_signal vs ove_event_signal_from_isr).
true if the caller is in an ISR or equivalent interrupt-handling context, false otherwise. false. CONFIG_OVE_ASYNC.