Kernel/x86 - Added backtrace to running program in thread dump
[tpg/acess2.git] / KernelLand / Kernel / debug.c
index cb11f5f..f0d21fa 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);
@@ -150,7 +151,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 +229,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