Usermode/ld-acess - Disabled destructive relocation
[tpg/acess2.git] / KernelLand / Kernel / debug.c
index cb11f5f..2444cb1 100644 (file)
@@ -11,6 +11,7 @@
 
 // === IMPORTS ===
 extern void    Threads_Dump(void);
+extern void    Heap_Dump(void);
 extern void    KernelPanic_SetMode(void);
 extern void    KernelPanic_PutChar(char Ch);
 extern void    IPStack_SendDebugText(const char *Text);
@@ -112,9 +113,13 @@ void Debug_FmtS(int bUseKTerm, const char *format, ...)
 
 void Debug_KernelPanic(void)
 {
-       #if LOCK_DEBUG_OUTPUT
-       SHORTREL(&glDebug_Lock);
-       #endif
+       if( !gbDebug_IsKPanic )
+       {
+               #if LOCK_DEBUG_OUTPUT
+               SHORTREL(&glDebug_Lock);
+               #endif
+               VT_SetTerminal(7);
+       }
        gbDebug_IsKPanic ++;
        KernelPanic_SetMode();
 }
@@ -150,7 +155,7 @@ void Debug(const char *Fmt, ...)
        va_list args;
        
        #if LOCK_DEBUG_OUTPUT
-       SHORTLOCK(&glDebug_Lock);
+       if(!CPU_HAS_LOCK(&glDebug_Lock)) SHORTLOCK(&glDebug_Lock);
        #endif
 
        Debug_Puts(0, "Debug: ");
@@ -228,7 +233,8 @@ void Panic(const char *Fmt, ...)
        va_list args;
        
        #if LOCK_DEBUG_OUTPUT
-       SHORTLOCK(&glDebug_Lock);
+       if( !CPU_HAS_LOCK(&glDebug_Lock) )
+               SHORTLOCK(&glDebug_Lock);
        #endif
        // And never SHORTREL
        

UCC git Repository :: git.ucc.asn.au