X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/59ecf21e36b2332f6adf2a568ef555283d8c119a..64e5fa9a495e388c922157b9a616204c299f5e05:/lunaix-os/includes/lunaix/compiler.h diff --git a/lunaix-os/includes/lunaix/compiler.h b/lunaix-os/includes/lunaix/compiler.h index 137d288..3ee6fa0 100644 --- a/lunaix-os/includes/lunaix/compiler.h +++ b/lunaix-os/includes/lunaix/compiler.h @@ -8,6 +8,12 @@ #define weak __attribute__((weak)) #define noret __attribute__((noreturn)) #define optimize(opt) __attribute__((optimize(opt))) +#define must_inline __attribute__((always_inline)) + +#define clz(bits) __builtin_clz(bits) +#define sadd_overflow(a, b, of) __builtin_sadd_overflow(a, b, of) +#define umul_overflow(a, b, of) __builtin_umul_overflow(a, b, of) +#define offsetof(f, m) __builtin_offsetof(f, m) #define prefetch_rd(ptr, ll) __builtin_prefetch((ptr), 0, ll) #define prefetch_wr(ptr, ll) __builtin_prefetch((ptr), 1, ll) @@ -15,6 +21,9 @@ #define stringify(v) #v #define stringify__(v) stringify(v) +#define compact __attribute__((packed)) +#define align(v) __attribute__((aligned (v))) + inline static void noret spin() {