feat: device subsystem rework
[lunaix-os.git] / lunaix-os / includes / lunaix / spike.h
index ae193570f2b3bfaeb0af329d4e17f9ae94adb26e..a2a0e21d5f66c1c56e33e2947306fb930d78ca2e 100644 (file)
                                                       : 0)                      \
                              : (31 - __builtin_clz(x)))
 
-#define DO_SPIN                                                                \
-    while (1)                                                                  \
-        ;
-
-inline static void
+inline static void noret
 spin()
 {
-    DO_SPIN
+    volatile int __infloop = 1;
+    while (__infloop)
+        ;
+    __builtin_unreachable();
 }
 
 #ifndef __LUNAIXOS_NASSERT__
@@ -94,7 +93,7 @@ __assert_fail(const char* expr, const char* file, unsigned int line)
 #define assert(cond) (void)(cond);          // assert nothing
 #define assert_msg(cond, msg) (void)(cond); // assert nothing
 
-#endif                                      // __LUNAIXOS_NASSERT__
+#endif // __LUNAIXOS_NASSERT__
 
 void noret
 panick(const char* msg);