fix: make sometimes can't find 'python' if it's alias does not exported to makefile's shell
: 0) \
: (31 - __builtin_clz(x)))
-#define DO_SPIN \
- { \
- volatile int __infloop = 1; \
- while (__infloop) \
- ; \
- }
-
inline static void noret
spin()
{
- DO_SPIN
+ volatile int __infloop = 1;
+ while (__infloop)
+ ;
+ __builtin_unreachable();
}
#ifndef __LUNAIXOS_NASSERT__
#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);
static char buffer[1024];
-void
+void noret
__assert_fail(const char* expr, const char* file, unsigned int line)
{
ksprintf(buffer, "%s (%s:%u)", expr, file, line);
// kernel/asm/x86/interrupts.c)
cpu_trap_panic(buffer);
- DO_SPIN // never reach
+ spin(); // never reach
}
void noret
panick(const char* msg)
{
cpu_trap_panic(msg);
- DO_SPIN
+ spin();
}
void
va_end(args);
asm("int %0" ::"i"(LUNAIX_SYS_PANIC), "D"(buffer));
- DO_SPIN
+ spin();
}
CC := i686-elf-gcc
AS := i686-elf-as
AR := i686-elf-ar
-PY := python
+PY := python3
ARCH_OPT := -D__ARCH_IA32