2014-02-12 21:47:13 +00:00
|
|
|
|
|
|
|
#ifndef __CDEFS_H__
|
|
|
|
#define __CDEFS_H__
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2014-07-20 20:45:57 +00:00
|
|
|
#define PACKED __attribute__((__packed__))
|
|
|
|
#define PERCORE __attribute__((section(".data.percore")))
|
2014-02-12 21:47:13 +00:00
|
|
|
|
2014-07-20 20:45:57 +00:00
|
|
|
#define INLINE inline
|
2023-08-30 16:45:51 +00:00
|
|
|
#define ALWAYS_INLINE __attribute__((__always_inline__))
|
2014-07-20 20:45:57 +00:00
|
|
|
|
2023-08-30 16:45:51 +00:00
|
|
|
#define NO_RETURN __attribute__((noreturn))
|
2015-01-05 06:10:37 +00:00
|
|
|
#define UNREACHABLE __builtin_unreachable
|
2014-02-12 21:47:13 +00:00
|
|
|
|
2023-10-02 23:33:47 +00:00
|
|
|
#define UNUSED __attribute__((unused))
|
|
|
|
|
2014-09-05 06:26:02 +00:00
|
|
|
#define ROUNDUP(_x, _n) (((_x) + (_n) - 1) & ~((_n) - 1))
|
|
|
|
|
2023-08-30 16:45:51 +00:00
|
|
|
#define __MALLOC __attribute__((__malloc__))
|
|
|
|
|
|
|
|
#if __has_extension(c_thread_safety_attributes)
|
|
|
|
#define __NO_LOCK_ANALYSIS __attribute__((no_thread_safety_analysis))
|
|
|
|
#define __LOCKABLE __attribute__((lockable))
|
|
|
|
#define __LOCK_EX(_x) __attribute__((exclusive_lock_function(_x)))
|
|
|
|
#define __TRYLOCK_EX(_x) __attribute__((exclusive_trylock_function(_x)))
|
|
|
|
#define __UNLOCK_EX(_x) __attribute__((unlock_function(_x)))
|
|
|
|
#define __LOCK_EX_ASSERT(_x) __attribute__((assert_exclusive_lock(_x)))
|
|
|
|
#define __GUARDED_BY(_x) __attribute__((guarded_by(_x)))
|
|
|
|
#else
|
|
|
|
#define __NO_LOCK_ANALYSIS
|
|
|
|
#define __LOCKABLE
|
|
|
|
#define __LOCK_EX(_x)
|
|
|
|
#define __TRYLOCK_EX(_x)
|
|
|
|
#define __UNLOCK_EX(_x)
|
|
|
|
#define __LOCK_EX_ASSERT(_x)
|
|
|
|
#define __GUARDED_BY(_x)
|
|
|
|
#endif
|
|
|
|
|
2015-02-27 23:57:07 +00:00
|
|
|
#define __hidden __attribute__((__visibility__("hidden")))
|
|
|
|
|
2023-08-23 02:03:53 +00:00
|
|
|
#define __printflike(_fmt, _var) __attribute__((__format__(__printf__, _fmt, _var)))
|
|
|
|
|
2014-02-12 21:47:13 +00:00
|
|
|
#endif /* __CDEFS_H__ */
|
|
|
|
|