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
307 __atomic_store_n(ptr, value, __ATOMIC_RELEASE);
311 return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
448#define NROS_PLATFORM_TASK_DETACHED 0x01u
460#define NROS_PLATFORM_PRIORITY_MIN 0
461#define NROS_PLATFORM_PRIORITY_MAX 255
463#define NROS_PLATFORM_PRIORITY_INHERIT INT32_MIN
470#define NROS_PLATFORM_PRIORITY_RAW(n) (-0x40000000 - (int32_t) (n))
472#define NROS_PLATFORM_PRIORITY_IS_RAW(p) \
473 ((p) <= -0x40000000 && (p) != NROS_PLATFORM_PRIORITY_INHERIT)
475#define NROS_PLATFORM_PRIORITY_RAW_VALUE(p) (-0x40000000 - (int32_t) (p))
493 void *(*entry)(
void *),
void *arg);
555#ifndef NROS_PLATFORM_TASK_STORAGE_SIZE
567# define NROS_PLATFORM_TASK_STORAGE_SIZE 512
569#ifndef NROS_PLATFORM_MUTEX_STORAGE_SIZE
576# define NROS_PLATFORM_MUTEX_STORAGE_SIZE 256
578#ifndef NROS_PLATFORM_MUTEX_REC_STORAGE_SIZE
579# define NROS_PLATFORM_MUTEX_REC_STORAGE_SIZE 256
581#ifndef NROS_PLATFORM_CONDVAR_STORAGE_SIZE
584# define NROS_PLATFORM_CONDVAR_STORAGE_SIZE 256
586#ifndef NROS_PLATFORM_STORAGE_ALIGN
588# define NROS_PLATFORM_STORAGE_ALIGN 8
743 const uint8_t *name_ptr, uintptr_t name_len,
744 const uint8_t *msg_ptr, uintptr_t msg_len);
760 const uint8_t *name_ptr, uintptr_t name_len,
761 const uint8_t *msg_ptr, uintptr_t msg_len);
821#if defined(__cplusplus)
822# define NROS_PLATFORM_NORETURN [[noreturn]]
823#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
824# define NROS_PLATFORM_NORETURN _Noreturn
826# define NROS_PLATFORM_NORETURN __attribute__((noreturn))