X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/8b8f49b713d64065775fe538232f8639083601bd..59ecf21e36b2332f6adf2a568ef555283d8c119a:/lunaix-os/includes/lunaix/compiler.h?ds=inline diff --git a/lunaix-os/includes/lunaix/compiler.h b/lunaix-os/includes/lunaix/compiler.h index 72bffb7..137d288 100644 --- a/lunaix-os/includes/lunaix/compiler.h +++ b/lunaix-os/includes/lunaix/compiler.h @@ -7,4 +7,21 @@ #define weak_alias(name) __attribute__((weak, alias(name))) #define weak __attribute__((weak)) #define noret __attribute__((noreturn)) +#define optimize(opt) __attribute__((optimize(opt))) + +#define prefetch_rd(ptr, ll) __builtin_prefetch((ptr), 0, ll) +#define prefetch_wr(ptr, ll) __builtin_prefetch((ptr), 1, ll) + +#define stringify(v) #v +#define stringify__(v) stringify(v) + +inline static void noret +spin() +{ + volatile int __infloop = 1; + while (__infloop) + ; + __builtin_unreachable(); +} + #endif /* __LUNAIX_COMPILER_H */