From b0f29fe3053452e7bf65fe0d48bed2f1915fcc1e Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 17 Aug 2023 16:04:47 +0000 Subject: kernel: cdefs: Move attributes above other macros git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@31 a8a8aea2-181d-ee11-89e8-15fd0e089fc4 --- sys/include/sys/cdefs.h | 52 ++++++++++++++++++++++++------------------------- 1 file 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_ */ -- cgit v1.2.3