Fixed threading bug
[tpg/acess2.git] / Kernel / arch / x86 / kpanic.c
index 865b0d3..dc1a719 100644 (file)
@@ -55,12 +55,17 @@ const struct {
 /**
  * \brief Sets the screen mode for a kernel panic
  */
-void KernelPanic_SetMode()
+void KernelPanic_SetMode(void)
 {
         int    i;
        
+       // This function is called by Panic(), but MM_PageFault and the
+       // CPU exception handers also call it, so let's not clear the screen
+       // twice
+       if( giKP_Pos )  return ;
+       
        // Restore VGA 0xB8000 text mode
-       #if 1
+       #if 0
        for( i = 0; i < NUM_REGVALUES; i++ )
        {
                // Reset Flip-Flop

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