Kernel - Fixed freeze (I think)
authorJohn Hodge <[email protected]>
Mon, 13 Feb 2012 10:33:42 +0000 (18:33 +0800)
committerJohn Hodge <[email protected]>
Mon, 13 Feb 2012 10:33:42 +0000 (18:33 +0800)
- Caused by Proc_Scheduler not ACKing IRQ before doing shite

KernelLand/Kernel/arch/x86/proc.c
KernelLand/Kernel/time.c

index 8d85608..fb6b52d 100644 (file)
@@ -978,14 +978,23 @@ void Proc_Reschedule(void)
  */
 void Proc_Scheduler(int CPU)
 {
+       #if USE_MP
+       if( GetCPUNum() )
+               gpMP_LocalAPIC->EOI.Val = 0;
+       else
+       #endif
+               outb(0x20, 0x20);
+       __asm__ __volatile__ ("sti");   
+
+       gaCPUs[CPU].LastTimerThread = gaCPUs[CPU].Current;
+       // Call the timer update code
+       Timer_CallTimers();
+
        // If two ticks happen within the same task, and it's not an idle task, swap
        if( gaCPUs[CPU].Current->TID > giNumCPUs && gaCPUs[CPU].Current == gaCPUs[CPU].LastTimerThread )
        {
                Proc_Reschedule();
        }
-       gaCPUs[CPU].LastTimerThread = gaCPUs[CPU].Current;
-       // Call the timer update code
-       Timer_CallTimers();
 }
 
 // === EXPORTS ===
index d4fd5ec..d8c2924 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Acess 2
+ * Acess2 Kernel
  * - By John Hodge (thePowersGang) 
  *
  * Timer Code

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