X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=geekos%2Finclude%2Fgeekos%2Fkassert.h;fp=geekos%2Finclude%2Fgeekos%2Fkassert.h;h=65e2db3eac80355591e913803ccb89b67c49f293;hp=434a8a8517472846af243177b80e00ccb389be13;hb=dff5e69505c2893d062acf50f2268b3528c9556f;hpb=4e78dc8d5ae0bcf146eb425c8a53178a1fb758e8 diff --git a/geekos/include/geekos/kassert.h b/geekos/include/geekos/kassert.h index 434a8a8..65e2db3 100644 --- a/geekos/include/geekos/kassert.h +++ b/geekos/include/geekos/kassert.h @@ -19,6 +19,7 @@ extern struct Kernel_Thread* g_currentThread; #define KASSERT(cond) \ do { \ + extern void Halt(); \ if (!(cond)) { \ Set_Current_Attr(ATTRIB(RED, GRAY|BRIGHT)); \ Print("Failed assertion in %s: %s at %s, line %d, RA=%lx, thread=%p\n",\ @@ -26,16 +27,17 @@ do { \ (ulong_t) __builtin_return_address(0), \ g_currentThread); \ while (1) \ - ; \ + Halt(); \ } \ } while (0) #define TODO(message) \ -do { \ + do { \ + extern void Halt(); \ Set_Current_Attr(ATTRIB(BLUE, GRAY|BRIGHT)); \ Print("Unimplemented feature: %s\n", (message)); \ while (1) \ - ; \ + Halt(); \ } while (0) /* @@ -66,7 +68,7 @@ do { \ * Its behavior does not depend on whether or not this * is a debug build. */ -#define STOP() while (1) +#define STOP() while (1) {Halt();} /* * Panic function. @@ -75,7 +77,7 @@ do { \ do { \ Set_Current_Attr(ATTRIB(RED, GRAY|BRIGHT)); \ Print(args); \ - while (1) ; \ + while (1) Halt(); \ } while (0) #endif /* GEEKOS_KASSERT_H */