µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os-c-api.h File Reference
#include <cmsis-plus/rtos/os-c-decls.h>
#include <cmsis-plus/rtos/os-hooks.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

Compatibility Macros
#define os_thread_create   os_thread_construct
 
#define os_thread_destroy   os_thread_destruct
 
#define os_timer_create   os_timer_construct
 
#define os_timer_destroy   os_timer_destruct
 
#define os_mutex_create   os_mutex_construct
 
#define os_mutex_recursive_create   os_mutex_recursive_construct
 
#define os_mutex_destroy   os_mutex_destruct
 
#define os_condvar_create   os_condvar_construct
 
#define os_condvar_destroy   os_condvar_destruct
 
#define os_semaphore_create   os_semaphore_construct
 
#define os_semaphore_binary_create   os_semaphore_binary_construct
 
#define os_semaphore_counting_create   os_semaphore_counting_construct
 
#define os_semaphore_destroy   os_semaphore_destruct
 
#define os_mempool_create   os_mempool_construct
 
#define os_mempool_destroy   os_mempool_destruct
 
#define os_mqueue_create   os_mqueue_construct
 
#define os_mqueue_destroy   os_mqueue_destruct
 
#define os_evflags_create   os_evflags_construct
 
#define os_evflags_destroy   os_evflags_destruct
 

Enumerations

Return Codes
enum  { os_ok = 0 }
 Return codes, in addition to POSIX codes. More...
 

Functions

Main Thread Function
int os_main (int argc, char *argv[])
 Application entry point, running on the main thread context. More...
 
Scheduler Functions
os_result_t os_sched_initialize (void)
 Initialise the RTOS scheduler. More...
 
void os_sched_start (void)
 Start the RTOS scheduler. More...
 
bool os_sched_is_started (void)
 Check if the scheduler was started. More...
 
os_sched_state_t os_sched_lock (void)
 Lock the scheduler. More...
 
os_sched_state_t os_sched_unlock (void)
 Unlock the scheduler. More...
 
os_sched_state_t os_sched_set_locked (os_sched_state_t state)
 Lock/unlock the scheduler. More...
 
bool os_sched_is_locked (void)
 Check if the scheduler is locked. More...
 
bool os_sched_is_preemptive (void)
 Check if the scheduler is in preemptive mode. More...
 
bool os_sched_set_preemptive (bool state)
 Set the scheduler preemptive mode. More...
 
Scheduler Statistics Functions
os_statistics_counter_t os_sched_stat_get_context_switches (void)
 Get the total number of context switches. More...
 
os_statistics_duration_t os_sched_stat_get_cpu_cycles (void)
 Get the total duration of all threads. More...
 
Interrupts Functions
bool os_irq_in_handler_mode (void)
 Check if the CPU is in handler mode. More...
 
os_irq_state_t os_irq_critical_enter (void)
 Enter an interrupts critical section. More...
 
void os_irq_critical_exit (os_irq_state_t state)
 Exit the interrupts critical section. More...
 
os_irq_state_t os_irq_uncritical_enter (void)
 Enter an interrupts uncritical section. More...
 
void os_irq_uncritical_exit (os_irq_state_t state)
 Exit the interrupts uncritical section. More...
 
os_thread_stack_tos_irq_get_stack (void)
 Get the interrupts stack. More...
 
Current Thread Functions
os_thread_tos_this_thread (void)
 Get the current running thread. More...
 
void os_this_thread_suspend (void)
 Suspend the current running thread to wait for an event. More...
 
void os_this_thread_exit (void *exit_ptr)
 Terminate the current running thread. More...
 
os_result_t os_this_thread_flags_wait (os_flags_mask_t mask, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Wait for thread event flags. More...
 
os_result_t os_this_thread_flags_try_wait (os_flags_mask_t mask, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Try to wait for thread event flags. More...
 
os_result_t os_this_thread_flags_timed_wait (os_flags_mask_t mask, os_clock_duration_t timeout, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Timed wait for thread event flags. More...
 
os_result_t os_this_thread_flags_clear (os_flags_mask_t mask, os_flags_mask_t *oflags)
 Clear thread event flags. More...
 
os_flags_mask_t os_this_thread_flags_get (os_flags_mask_t mask, os_flags_mode_t mode)
 Get/clear thread event flags. More...
 
Thread Attribute Functions
void os_thread_attr_init (os_thread_attr_t *attr)
 Initialise the thread attributes. More...
 
Thread Creation Functions
void os_thread_construct (os_thread_t *thread, const char *name, os_thread_func_t func, const os_thread_func_args_t args, const os_thread_attr_t *attr)
 Construct a statically allocated thread object instance. More...
 
void os_thread_destruct (os_thread_t *thread)
 Destruct the statically allocated thread object instance. More...
 
os_thread_tos_thread_new (const char *name, os_thread_func_t func, const os_thread_func_args_t args, const os_thread_attr_t *attr)
 Allocate a thread object instance and construct it. More...
 
void os_thread_delete (os_thread_t *thread)
 Destruct the thread object instance and deallocate it. More...
 
Thread Functions
const char * os_thread_get_name (os_thread_t *thread)
 Get the thread name. More...
 
os_thread_prio_t os_thread_get_priority (os_thread_t *thread)
 Get the thread current scheduling priority. More...
 
os_result_t os_thread_set_priority (os_thread_t *thread, os_thread_prio_t prio)
 Set the thread dynamic scheduling priority. More...
 
os_result_t os_thread_join (os_thread_t *thread, void **exit_ptr)
 Wait for thread termination. More...
 
void os_thread_resume (os_thread_t *thread)
 Resume the thread. More...
 
os_result_t os_thread_flags_raise (os_thread_t *thread, os_flags_mask_t mask, os_flags_mask_t *oflags)
 Raise thread event flags. More...
 
os_thread_state_t os_thread_get_state (os_thread_t *thread)
 Get the thread scheduler state. More...
 
os_thread_user_storage_t * os_thread_get_user_storage (os_thread_t *thread)
 Get the thread user storage. More...
 
os_thread_stack_tos_thread_get_stack (os_thread_t *thread)
 Get the thread context stack. More...
 
Thread Stack Functions
size_t os_thread_stack_get_default_size (void)
 Get the default stack size. More...
 
size_t os_thread_stack_set_default_size (size_t size_bytes)
 Set the default stack size. More...
 
size_t os_thread_stack_get_min_size (void)
 Get the min stack size. More...
 
size_t os_thread_stack_set_min_size (size_t size_bytes)
 Set the min stack size. More...
 
os_thread_stack_element_tos_thread_stack_get_bottom (os_thread_stack_t *stack)
 Get the stack lowest reserved address. More...
 
os_thread_stack_element_tos_thread_stack_get_top (os_thread_stack_t *stack)
 Get the top stack address. More...
 
size_t os_thread_stack_get_size (os_thread_stack_t *stack)
 Get the stack size. More...
 
size_t os_thread_stack_get_available (os_thread_stack_t *stack)
 Compute how much available stack remains. More...
 
bool os_thread_stack_check_bottom_magic (os_thread_stack_t *stack)
 Check if bottom magic word is still there. More...
 
bool os_thread_stack_check_top_magic (os_thread_stack_t *stack)
 Check if top magic word is still there. More...
 
Thread Statistics Functions
os_statistics_counter_t os_thread_stat_get_context_switches (os_thread_t *thread)
 Get the number of thread context switches. More...
 
os_statistics_duration_t os_thread_stat_get_cpu_cycles (os_thread_t *thread)
 Get the thread execution time. More...
 
Thread Children Iterator Functions
os_iterator_t os_children_threads_iter_begin (os_thread_t *thread)
 Get the beginning of the list of children threads. More...
 
os_iterator_t os_children_threads_iter_end (os_thread_t *thread)
 Get the end of the list of children threads. More...
 
os_thread_tos_children_threads_iter_get (os_iterator_t iterator)
 Get the thread from the current iterator position. More...
 
os_iterator_t os_children_threads_iter_next (os_iterator_t iterator)
 Advance the iterator to the next position. More...
 
Clock Functions
const char * os_clock_get_name (os_clock_t *clock)
 Get the clock name. More...
 
os_clock_timestamp_t os_clock_now (os_clock_t *clock)
 Tell the current time, possibly adjusted for epoch. More...
 
os_clock_timestamp_t os_clock_steady_now (os_clock_t *clock)
 Tell the current time since startup. More...
 
os_result_t os_clock_sleep_for (os_clock_t *clock, os_clock_duration_t duration)
 Sleep for a relative duration. More...
 
os_result_t os_clock_sleep_until (os_clock_t *clock, os_clock_timestamp_t timestamp)
 Sleep until an absolute timestamp. More...
 
os_result_t os_clock_wait_for (os_clock_t *clock, os_clock_duration_t timeout)
 Timed wait for an event. More...
 
os_clock_offset_t os_clock_get_offset (os_clock_t *clock)
 Get adjustment offset. More...
 
os_clock_offset_t os_clock_set_offset (os_clock_t *clock, os_clock_offset_t offset)
 Set adjustment offset. More...
 
os_clock_tos_clock_get_sysclock (void)
 Get sysclock (the system clock). More...
 
os_clock_tos_clock_get_rtclock (void)
 Get rtclock (the real-time clock). More...
 
os_clock_tos_clock_get_hrclock (void)
 Get hrclock (the high resolution clock). More...
 
os_clock_timestamp_t os_sysclock_now (void)
 Tell the current time since startup. More...
 
os_result_t os_sysclock_sleep_for (os_clock_duration_t duration)
 Sleep for a relative duration. More...
 
os_result_t os_sysclock_sleep_until (os_clock_timestamp_t timestamp)
 Sleep until an absolute timestamp. More...
 
os_result_t os_sysclock_wait_for (os_clock_duration_t timeout)
 Timed wait for an event. More...
 
os_clock_duration_t os_sysclock_ticks_cast (uint32_t microsec)
 Convert microseconds to ticks. More...
 
os_clock_duration_t os_sysclock_ticks_cast_long (uint64_t microsec)
 Convert microseconds to ticks. More...
 
Timer Attribute Functions
void os_timer_attr_init (os_timer_attr_t *attr)
 Initialise the single shot timer attributes. More...
 
void os_timer_attr_periodic_init (os_timer_attr_t *attr)
 Initialise the periodic timer attributes. More...
 
const os_timer_attr_tos_timer_attr_get_periodic (void)
 Get a periodic timer attributes object instance. More...
 
Timer Creation Functions
void os_timer_construct (os_timer_t *timer, const char *name, os_timer_func_t function, os_timer_func_args_t args, const os_timer_attr_t *attr)
 Construct a statically allocated timer object instance. More...
 
void os_timer_destruct (os_timer_t *timer)
 Destruct the statically allocated timer object instance. More...
 
os_timer_tos_timer_new (const char *name, os_timer_func_t function, os_timer_func_args_t args, const os_timer_attr_t *attr)
 Allocate a timer object instance and construct it. More...
 
void os_timer_delete (os_timer_t *timer)
 Destruct the timer object instance and deallocate it. More...
 
Timer Functions
const char * os_timer_get_name (os_timer_t *timer)
 Get the timer name. More...
 
os_result_t os_timer_start (os_timer_t *timer, os_clock_duration_t period)
 Start or restart the timer. More...
 
os_result_t os_timer_stop (os_timer_t *timer)
 Stop the timer. More...
 
Mutex Attributes Functions
void os_mutex_attr_init (os_mutex_attr_t *attr)
 Initialise the mutex attributes. More...
 
void os_mutex_attr_recursive_init (os_mutex_attr_t *attr)
 Initialise the recursive mutex attributes. More...
 
const os_mutex_attr_tos_mutex_attr_get_recursive (void)
 Get a recursive mutex attributes object instance. More...
 
Mutex Creation Functions
void os_mutex_construct (os_mutex_t *mutex, const char *name, const os_mutex_attr_t *attr)
 Construct a statically allocated mutex object instance. More...
 
void os_mutex_recursive_construct (os_mutex_t *mutex, const char *name, const os_mutex_attr_t *attr)
 Construct a statically allocated recursive mutex object instance. More...
 
void os_mutex_destruct (os_mutex_t *mutex)
 Destruct the statically allocated mutex object instance. More...
 
os_mutex_tos_mutex_new (const char *name, const os_mutex_attr_t *attr)
 Allocate a mutex object instance and construct it. More...
 
os_mutex_tos_mutex_recursive_new (const char *name, const os_mutex_attr_t *attr)
 Allocated a recursive mutex object instance and construct it. More...
 
void os_mutex_delete (os_mutex_t *mutex)
 Destruct the mutex object instance and deallocate it. More...
 
Mutex Functions
const char * os_mutex_get_name (os_mutex_t *mutex)
 Get the mutex name. More...
 
os_result_t os_mutex_lock (os_mutex_t *mutex)
 Lock/acquire the mutex. More...
 
os_result_t os_mutex_try_lock (os_mutex_t *mutex)
 Try to lock/acquire the mutex. More...
 
os_result_t os_mutex_timed_lock (os_mutex_t *mutex, os_clock_duration_t timeout)
 Timed attempt to lock/acquire the mutex. More...
 
os_result_t os_mutex_unlock (os_mutex_t *mutex)
 Unlock/release the mutex. More...
 
os_thread_prio_t os_mutex_get_prio_ceiling (os_mutex_t *mutex)
 Get the priority ceiling of a mutex. More...
 
os_result_t os_mutex_set_prio_ceiling (os_mutex_t *mutex, os_thread_prio_t prio_ceiling, os_thread_prio_t *old_prio_ceiling)
 Change the priority ceiling of a mutex. More...
 
os_result_t os_mutex_mark_consistent (os_mutex_t *mutex)
 Mark mutex as consistent. More...
 
os_thread_tos_mutex_get_owner (os_mutex_t *mutex)
 Get the thread that owns the mutex. More...
 
os_mutex_type_t os_mutex_get_type (os_mutex_t *mutex)
 Get the mutex type. More...
 
os_mutex_protocol_t os_mutex_get_protocol (os_mutex_t *mutex)
 Get the mutex protocol. More...
 
os_mutex_robustness_t os_mutex_get_robustness (os_mutex_t *mutex)
 Get the mutex robustness. More...
 
os_result_t os_mutex_reset (os_mutex_t *mutex)
 Reset the mutex. More...
 
Condition Variable Attributes Functions
void os_condvar_attr_init (os_condvar_attr_t *attr)
 Initialise the condition variable attributes. More...
 
Condition Variable Creation Functions
void os_condvar_construct (os_condvar_t *condvar, const char *name, const os_condvar_attr_t *attr)
 Construct a statically allocated condition variable object instance. More...
 
void os_condvar_destruct (os_condvar_t *condvar)
 Destruct the statically allocated condition variable object instance. More...
 
os_condvar_tos_condvar_new (const char *name, const os_condvar_attr_t *attr)
 Allocate a condition variable object instance and construct it. More...
 
void os_condvar_delete (os_condvar_t *condvar)
 Destruct the condition variable object instance and deallocate it. More...
 
Condition Variable Functions
const char * os_condvar_get_name (os_condvar_t *condvar)
 Get the condition variable name. More...
 
os_result_t os_condvar_signal (os_condvar_t *condvar)
 Notify one thread waiting for a condition variable. More...
 
os_result_t os_condvar_broadcast (os_condvar_t *condvar)
 Notify all threads waiting for a condition variable. More...
 
os_result_t os_condvar_wait (os_condvar_t *condvar, os_mutex_t *mutex)
 Wait for a condition variable to be notified. More...
 
os_result_t os_condvar_timed_wait (os_condvar_t *condvar, os_mutex_t *mutex, os_clock_duration_t timeout)
 Timed wait for a condition variable to be notified. More...
 
Semaphore Attributes Functions
void os_semaphore_attr_init (os_semaphore_attr_t *attr)
 Initialise the counting semaphore attributes. More...
 
void os_semaphore_attr_binary_init (os_semaphore_attr_t *attr, const os_semaphore_count_t initial_value)
 Initialise the binary semaphore attributes. More...
 
void os_semaphore_attr_counting_init (os_semaphore_attr_t *attr, const os_semaphore_count_t max_value, const os_semaphore_count_t initial_value)
 Initialise the counting semaphore attributes. More...
 
const os_semaphore_attr_tos_semaphore_attr_get_binary (void)
 Get a binary semaphore attributes object instance. More...
 
Semaphore Creation Functions
void os_semaphore_construct (os_semaphore_t *semaphore, const char *name, const os_semaphore_attr_t *attr)
 Construct a statically allocated semaphore object instance. More...
 
void os_semaphore_binary_construct (os_semaphore_t *semaphore, const char *name, const os_semaphore_count_t initial_value)
 Construct a statically allocated binary semaphore object instance. More...
 
void os_semaphore_counting_construct (os_semaphore_t *semaphore, const char *name, const os_semaphore_count_t max_value, const os_semaphore_count_t initial_value)
 Construct a statically allocated counting semaphore object instance. More...
 
void os_semaphore_destruct (os_semaphore_t *semaphore)
 Destruct the statically allocated semaphore object instance. More...
 
os_semaphore_tos_semaphore_new (const char *name, const os_semaphore_attr_t *attr)
 Allocated a semaphore object instance and construct it. More...
 
os_semaphore_tos_semaphore_binary_new (const char *name, const os_semaphore_count_t initial_value)
 Allocate a binary semaphore object instance and construct it. More...
 
os_semaphore_tos_semaphore_counting_new (const char *name, const os_semaphore_count_t max_value, const os_semaphore_count_t initial_value)
 Allocate a counting semaphore object instance and construct it. More...
 
void os_semaphore_delete (os_semaphore_t *semaphore)
 Destruct the semaphore object instance. More...
 
Semaphore Functions
const char * os_semaphore_get_name (os_semaphore_t *semaphore)
 Get the semaphore name. More...
 
os_result_t os_semaphore_post (os_semaphore_t *semaphore)
 Post (unlock) the semaphore. More...
 
os_result_t os_semaphore_wait (os_semaphore_t *semaphore)
 Lock the semaphore, possibly waiting. More...
 
os_result_t os_semaphore_try_wait (os_semaphore_t *semaphore)
 Try to lock the semaphore. More...
 
os_result_t os_semaphore_timed_wait (os_semaphore_t *semaphore, os_clock_duration_t timeout)
 Timed wait to lock the semaphore. More...
 
os_semaphore_count_t os_semaphore_get_value (os_semaphore_t *semaphore)
 Get the semaphore count value. More...
 
os_result_t os_semaphore_reset (os_semaphore_t *semaphore)
 Reset the semaphore. More...
 
os_semaphore_count_t os_semaphore_get_initial_value (os_semaphore_t *semaphore)
 Get the semaphore initial count value. More...
 
os_semaphore_count_t os_semaphore_get_max_value (os_semaphore_t *semaphore)
 Get the semaphore maximum count value. More...
 
Memory Pool Attributes Functions
void os_mempool_attr_init (os_mempool_attr_t *attr)
 Initialise the memory pool attributes. More...
 
Memory Pool Creation Functions
void os_mempool_construct (os_mempool_t *mempool, const char *name, size_t blocks, size_t block_size_bytes, const os_mempool_attr_t *attr)
 Construct a statically allocated memory pool object instance. More...
 
void os_mempool_destruct (os_mempool_t *mempool)
 Destruct the statically allocated memory pool object instance. More...
 
os_mempool_tos_mempool_new (const char *name, size_t blocks, size_t block_size_bytes, const os_mempool_attr_t *attr)
 Allocate a memory pool object instance and construct it. More...
 
void os_mempool_delete (os_mempool_t *mempool)
 Destruct the memory pool object instance and deallocate it. More...
 
Memory Pool Functions
const char * os_mempool_get_name (os_mempool_t *mempool)
 Get the memory pool name. More...
 
void * os_mempool_alloc (os_mempool_t *mempool)
 Allocate a memory block. More...
 
void * os_mempool_try_alloc (os_mempool_t *mempool)
 Try to allocate a memory block. More...
 
void * os_mempool_timed_alloc (os_mempool_t *mempool, os_clock_duration_t timeout)
 Allocate a memory block with timeout. More...
 
os_result_t os_mempool_free (os_mempool_t *mempool, void *block)
 Free the memory block. More...
 
size_t os_mempool_get_capacity (os_mempool_t *mempool)
 Get memory pool capacity. More...
 
size_t os_mempool_get_count (os_mempool_t *mempool)
 Get blocks count. More...
 
size_t os_mempool_get_block_size (os_mempool_t *mempool)
 Get block size. More...
 
bool os_mempool_is_empty (os_mempool_t *mempool)
 Check if the memory pool is empty. More...
 
bool os_mempool_is_full (os_mempool_t *mempool)
 Check if the memory pool is full. More...
 
os_result_t os_mempool_reset (os_mempool_t *mempool)
 Reset the memory pool. More...
 
void * os_mempool_get_pool (os_mempool_t *mempool)
 Get the pool storage address. More...
 
Message Queue Attributes Functions
void os_mqueue_attr_init (os_mqueue_attr_t *attr)
 Initialise the message queue attributes. More...
 
Message Queue Creation Functions
void os_mqueue_construct (os_mqueue_t *mqueue, const char *name, size_t msgs, size_t msg_size_bytes, const os_mqueue_attr_t *attr)
 Construct a statically allocated message queue object instance. More...
 
void os_mqueue_destruct (os_mqueue_t *mqueue)
 Destruct the statically allocated message queue object instance. More...
 
os_mqueue_tos_mqueue_new (const char *name, size_t msgs, size_t msg_size_bytes, const os_mqueue_attr_t *attr)
 Allocate a message queue object instance and construct it. More...
 
void os_mqueue_delete (os_mqueue_t *mqueue)
 Destruct the message queue object instance and deallocate it. More...
 
Message Queue Functions
const char * os_mqueue_get_name (os_mqueue_t *mqueue)
 Get the message queue name. More...
 
os_result_t os_mqueue_send (os_mqueue_t *mqueue, const void *msg, size_t nbytes, os_mqueue_prio_t mprio)
 Send a message to the queue. More...
 
os_result_t os_mqueue_try_send (os_mqueue_t *mqueue, const void *msg, size_t nbytes, os_mqueue_prio_t mprio)
 Try to send a message to the queue. More...
 
os_result_t os_mqueue_timed_send (os_mqueue_t *mqueue, const void *msg, size_t nbytes, os_clock_duration_t timeout, os_mqueue_prio_t mprio)
 Send a message to the queue with timeout. More...
 
os_result_t os_mqueue_receive (os_mqueue_t *mqueue, void *msg, size_t nbytes, os_mqueue_prio_t *mprio)
 Receive a message from the queue. More...
 
os_result_t os_mqueue_try_receive (os_mqueue_t *mqueue, void *msg, size_t nbytes, os_mqueue_prio_t *mprio)
 Try to receive a message from the queue. More...
 
os_result_t os_mqueue_timed_receive (os_mqueue_t *mqueue, void *msg, size_t nbytes, os_clock_duration_t timeout, os_mqueue_prio_t *mprio)
 Receive a message from the queue with timeout. More...
 
size_t os_mqueue_get_capacity (os_mqueue_t *mqueue)
 Get queue capacity. More...
 
size_t os_mqueue_get_length (os_mqueue_t *mqueue)
 Get queue length. More...
 
size_t os_mqueue_get_msg_size (os_mqueue_t *mqueue)
 Get message size. More...
 
bool os_mqueue_is_empty (os_mqueue_t *mqueue)
 Check if the queue is empty. More...
 
bool os_mqueue_is_full (os_mqueue_t *mqueue)
 Check if the queue is full. More...
 
os_result_t os_mqueue_reset (os_mqueue_t *mqueue)
 Reset the message queue. More...
 
Event Flags Attributes Functions
void os_evflags_attr_init (os_evflags_attr_t *attr)
 Initialise the event flags attributes. More...
 
Event Flags Creation Functions
void os_evflags_construct (os_evflags_t *evflags, const char *name, const os_evflags_attr_t *attr)
 Construct a statically allocated event flags object instance. More...
 
void os_evflags_destruct (os_evflags_t *evflags)
 Destruct the statically allocated event flags object instance. More...
 
os_evflags_tos_evflags_new (const char *name, const os_evflags_attr_t *attr)
 Allocate an event flags object instance and construct it. More...
 
void os_evflags_delete (os_evflags_t *evflags)
 Destruct the event flags object instance and deallocate it. More...
 
Event Flags Functions
const char * os_evflags_get_name (os_evflags_t *evflags)
 Get the event flags name. More...
 
os_result_t os_evflags_wait (os_evflags_t *evflags, os_flags_mask_t mask, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Wait for event flags. More...
 
os_result_t os_evflags_try_wait (os_evflags_t *evflags, os_flags_mask_t mask, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Try to wait for event flags. More...
 
os_result_t os_evflags_timed_wait (os_evflags_t *evflags, os_flags_mask_t mask, os_clock_duration_t timeout, os_flags_mask_t *oflags, os_flags_mode_t mode)
 Timed wait for event flags. More...
 
os_result_t os_evflags_raise (os_evflags_t *evflags, os_flags_mask_t mask, os_flags_mask_t *oflags)
 Raise event flags. More...
 
os_result_t os_evflags_clear (os_evflags_t *evflags, os_flags_mask_t mask, os_flags_mask_t *oflags)
 Clear event flags. More...
 
os_flags_mask_t os_evflags_get (os_evflags_t *evflags, os_flags_mask_t mask, os_flags_mode_t mode)
 Get (and possibly clear) event flags. More...
 
bool os_evflags_are_waiting (os_evflags_t *evflags)
 Check if there are threads waiting. More...
 
Memory Management Functions
os_memory_tos_memory_get_default (void)
 Get the application default memory resource (free store). More...
 
void * os_memory_allocate (os_memory_t *memory, size_t bytes, size_t alignment)
 Allocate a block of memory. More...
 
void os_memory_deallocate (os_memory_t *memory, void *addr, size_t bytes, size_t alignment)
 Deallocate the previously allocated block of memory. More...
 
void os_memory_reset (os_memory_t *memory)
 Reset the memory manager to the initial state. More...
 
bool os_memory_coalesce (os_memory_t *memory)
 Coalesce free blocks. More...
 
size_t os_memory_get_total_bytes (os_memory_t *memory)
 Get the total size of managed memory. More...
 
size_t os_memory_get_allocated_bytes (os_memory_t *memory)
 Get the total size of allocated chunks. More...
 
size_t os_memory_get_free_bytes (os_memory_t *memory)
 Get the total size of free chunks. More...
 
size_t os_memory_get_allocated_chunks (os_memory_t *memory)
 Get the number of allocated chunks. More...
 
size_t os_memory_get_free_chunks (os_memory_t *memory)
 Get the number of free chunks. More...