X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.c;h=2413a6e2bde480a92f34c08dc301bc0fbff6a7a2;hb=0259a3c08b2c7d5c9d05bd0d051a67399e755638;hp=448eab27d4ba4d67613f4ea76fa4c81ff8179df8;hpb=35e419b3110ef56ffdc3f16c1fc819874b888ba5;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 448eab27..2413a6e2 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -24,6 +24,7 @@ extern int giNumCPUs; extern int giNextTID; extern int giTotalTickets; extern int giNumActiveThreads; +extern tThread gThreadZero; extern tThread *gActiveThreads; extern tThread *gSleepingThreads; extern tThread *gDeleteThreads; @@ -39,7 +40,7 @@ void Proc_Scheduler(); // === GLOBALS === // --- Current State --- #if USE_MP -tThread **gCurrentThread = NULL; +tThread *gCurrentThread[MAX_CPUS] = {NULL}; #else tThread *gCurrentThread = NULL; #endif @@ -124,6 +125,12 @@ void ArchThreads_Init() } #endif + #if USE_MP + gCurrentThread[0] = &gThreadZero; + #else + gCurrentThread = &gThreadZero; + #endif + // Set timer frequency outb(0x43, 0x34); // Set Channel 0, Low/High, Rate Generator outb(0x40, TIMER_DIVISOR&0xFF); // Low Byte of Divisor @@ -134,7 +141,14 @@ void ArchThreads_Init() // Change Stacks Proc_ChangeStack(); - +} + +/** + * \fn void Proc_Start() + * \brief Start process scheduler + */ +void Proc_Start() +{ // Start Interrupts (and hence scheduler) __asm__ __volatile__("sti"); }