From 533eecb9c9c351c668c3a6b9d49f28325a914162 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 13 Feb 2012 18:33:42 +0800 Subject: [PATCH] Kernel - Fixed freeze (I think) - Caused by Proc_Scheduler not ACKing IRQ before doing shite --- KernelLand/Kernel/arch/x86/proc.c | 15 ++++++++++++--- KernelLand/Kernel/time.c | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/KernelLand/Kernel/arch/x86/proc.c b/KernelLand/Kernel/arch/x86/proc.c index 8d856086..fb6b52de 100644 --- a/KernelLand/Kernel/arch/x86/proc.c +++ b/KernelLand/Kernel/arch/x86/proc.c @@ -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 === diff --git a/KernelLand/Kernel/time.c b/KernelLand/Kernel/time.c index d4fd5ec5..d8c29245 100644 --- a/KernelLand/Kernel/time.c +++ b/KernelLand/Kernel/time.c @@ -1,5 +1,5 @@ /* - * Acess 2 + * Acess2 Kernel * - By John Hodge (thePowersGang) * * Timer Code -- 2.20.1