68#ifndef NROS_PLATFORM_HAS_ATOMICS
69# define NROS_PLATFORM_HAS_ATOMICS
89#if !defined(NROS_PLATFORM_BAREMETAL)
90# ifndef NROS_PLATFORM_HAS_MALLOC
91# define NROS_PLATFORM_HAS_MALLOC
126#define NROS_PLATFORM_RET_OK 0
128#define NROS_PLATFORM_RET_ERROR -1
133#define NROS_PLATFORM_RET_UNSUPPORTED -5
138#define NROS_PLATFORM_RET_NOMEM -6
142#define NROS_PLATFORM_RET_INVALID -7
146#define NROS_PLATFORM_RET_TIMEOUT -8
248#ifdef NROS_PLATFORM_HAS_MALLOC
324 __atomic_store_n(ptr, value, __ATOMIC_RELEASE);
328 return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
465#define NROS_PLATFORM_TASK_DETACHED 0x01u
477#define NROS_PLATFORM_PRIORITY_MIN 0
478#define NROS_PLATFORM_PRIORITY_MAX 255
480#define NROS_PLATFORM_PRIORITY_INHERIT INT32_MIN
487#define NROS_PLATFORM_PRIORITY_RAW(n) (-0x40000000 - (int32_t) (n))
489#define NROS_PLATFORM_PRIORITY_IS_RAW(p) \
490 ((p) <= -0x40000000 && (p) != NROS_PLATFORM_PRIORITY_INHERIT)
492#define NROS_PLATFORM_PRIORITY_RAW_VALUE(p) (-0x40000000 - (int32_t) (p))
510 void *(*entry)(
void *),
void *arg);
572#ifndef NROS_PLATFORM_TASK_STORAGE_SIZE
584# define NROS_PLATFORM_TASK_STORAGE_SIZE 512
586#ifndef NROS_PLATFORM_MUTEX_STORAGE_SIZE
593# define NROS_PLATFORM_MUTEX_STORAGE_SIZE 256
595#ifndef NROS_PLATFORM_MUTEX_REC_STORAGE_SIZE
596# define NROS_PLATFORM_MUTEX_REC_STORAGE_SIZE 256
598#ifndef NROS_PLATFORM_CONDVAR_STORAGE_SIZE
601# define NROS_PLATFORM_CONDVAR_STORAGE_SIZE 256
603#ifndef NROS_PLATFORM_STORAGE_ALIGN
605# define NROS_PLATFORM_STORAGE_ALIGN 8
756#define NROS_PLATFORM_PARK_SIGNALLED 0
757#define NROS_PLATFORM_PARK_EXPIRED 1
758#define NROS_PLATFORM_PARK_YIELDED 2
780 uint64_t deadline_us);
836 const uint8_t *name_ptr, uintptr_t name_len,
837 const uint8_t *msg_ptr, uintptr_t msg_len);
853 const uint8_t *name_ptr, uintptr_t name_len,
854 const uint8_t *msg_ptr, uintptr_t msg_len);
914#if defined(__cplusplus)
915# define NROS_PLATFORM_NORETURN [[noreturn]]
916#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
917# define NROS_PLATFORM_NORETURN _Noreturn
919# define NROS_PLATFORM_NORETURN __attribute__((noreturn))