diff options
author | ian <ian> | 2023-08-17 16:04:47 +0000 |
---|---|---|
committer | ian <ian> | 2023-08-17 16:04:47 +0000 |
commit | b0f29fe3053452e7bf65fe0d48bed2f1915fcc1e (patch) | |
tree | e96c52c791486747e26e845c11a74dd74c0e2fdf | |
parent | 8bde9e4f37df7cc6b60d818363e5981e46356b3d (diff) |
kernel: cdefs: Move attributes above other macros
git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@31 a8a8aea2-181d-ee11-89e8-15fd0e089fc4
-rw-r--r-- | sys/include/sys/cdefs.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/sys/include/sys/cdefs.h b/sys/include/sys/cdefs.h index b57be39..e01502f 100644 --- a/sys/include/sys/cdefs.h +++ b/sys/include/sys/cdefs.h @@ -40,6 +40,32 @@ #define __weak __attr(weak) #define __used __attr(used) +/* Pack a structure */ +#define __packed __attribute__((__packed__)) + +/* Align by `n` */ +#define __aligned(n) __attribute__((__aligned__(n))) + +/* + * Align to a cacheline-boundary which is + * typically 64 bytes. + * + * XXX: Should probably deal with the case of the + * cacheline alignment boundary not being 64 bytes. + */ +#define __cacheline_aligned __aligned(64) + +/* + * To be used when an empty body is required like: + * + * #ifdef DEBUG + * #define dprintf(a) printf(a) + * #else + * #define dprintf(a) __nothing + * #endif + */ +#define __nothing ((void)0) + /* __BIT(n): Set nth bit, where __BIT(0) == 0x1 */ #define __BIT(n) (1ULL << n) @@ -111,31 +137,5 @@ #define __MODULE_NAME(name) \ __used static const char *__THIS_MODULE = name -/* Pack a structure */ -#define __packed __attribute__((__packed__)) - -/* Align by `n` */ -#define __aligned(n) __attribute__((__aligned__(n))) - -/* - * Align to a cacheline-boundary which is - * typically 64 bytes. - * - * XXX: Should probably deal with the case of the - * cacheline alignment boundary not being 64 bytes. - */ -#define __cacheline_aligned __aligned(64) - -/* - * To be used when an empty body is required like: - * - * #ifdef DEBUG - * #define dprintf(a) printf(a) - * #else - * #define dprintf(a) __nothing - * #endif - */ -#define __nothing ((void)0) - #endif /* !defined(__ASSEMBLER__) */ #endif /* !_SYS_CDEFS_H_ */ |