2021-12-25 04:45:47 -05:00
|
|
|
#ifndef __MACROS_H__
|
|
|
|
|
#define __MACROS_H__
|
|
|
|
|
|
|
|
|
|
#define ALIGNED(x) __attribute__((aligned(x)))
|
|
|
|
|
|
2021-12-26 01:56:48 +00:00
|
|
|
#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0])))
|
|
|
|
|
|
2023-06-27 17:58:03 -07:00
|
|
|
#define STUBBED_PRINTF(x) ((void)(x))
|
2022-03-26 02:07:30 +00:00
|
|
|
|
|
|
|
|
#define UNUSED __attribute__((unused))
|
|
|
|
|
|
2025-02-20 12:17:14 -05:00
|
|
|
#define FALLTHROUGH __attribute__((fallthrough))
|
|
|
|
|
|
2022-03-26 02:07:30 +00:00
|
|
|
#ifndef __GNUC__
|
|
|
|
|
#define __attribute__(x)
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-08-19 22:19:01 -06:00
|
|
|
#define ALIGN8(val) (((val) + 7) & ~7)
|
|
|
|
|
|
2025-02-17 22:56:09 -05:00
|
|
|
#define STACK(stack, size) u64 stack[ALIGN8(size) / sizeof(u64)]
|
2024-08-19 22:19:01 -06:00
|
|
|
|
2025-02-17 22:56:09 -05:00
|
|
|
#define STACK_START(stack) ((u8*)(stack) + sizeof(stack))
|
2024-08-19 22:19:01 -06:00
|
|
|
|
2021-12-25 04:45:47 -05:00
|
|
|
#endif
|