#define DEBUG_MAX_LINE_LEN 256
#define LOCK_DEBUG_OUTPUT 1 // Avoid interleaving of output lines?
-#define TRACE_TO_KTERM 1 // Send ENTER/DEBUG/LEAVE to debug?
+#define TRACE_TO_KTERM 0 // Send ENTER/DEBUG/LEAVE to debug?
// === IMPORTS ===
extern void Threads_Dump(void);
void Debug_KernelPanic(void)
{
- if( !gbDebug_IsKPanic )
+ if( gbDebug_IsKPanic > 5 )
+ HALT_CPU();
+ gbDebug_IsKPanic ++;
+ if( gbDebug_IsKPanic == 1 )
{
#if LOCK_DEBUG_OUTPUT
SHORTREL(&glDebug_Lock);
VT_SetTerminal(7);
}
// 5 nested panics? Fuck it
- if( gbDebug_IsKPanic > 5 )
- HALT_CPU();
- gbDebug_IsKPanic ++;
KernelPanic_SetMode();
}
va_list args;
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
va_list args;
#if LOCK_DEBUG_OUTPUT
- if(!CPU_HAS_LOCK(&glDebug_Lock)) SHORTLOCK(&glDebug_Lock);
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
+ SHORTLOCK(&glDebug_Lock);
#endif
Debug_Puts(0, "Debug: ");
void LogFV(const char *Fmt, va_list args)
{
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
void LogV(const char *Fmt, va_list args)
{
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
va_list args;
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
Debug_Putchar('\r');
Debug_Putchar('\n');
+ Proc_PrintBacktrace();
//Threads_Dump();
//Heap_Dump();
tTID tid = Threads_GetTID();
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
tTID tid = Threads_GetTID();
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif
tTID tid = Threads_GetTID();
#if LOCK_DEBUG_OUTPUT
+ if(CPU_HAS_LOCK(&glDebug_Lock)) return ;
SHORTLOCK(&glDebug_Lock);
#endif