X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.c;h=45c5a56126ce89fb453b42e54ff9369d3ace3216;hb=f73bf5f5cf0e188bafe905091aa311627af54b76;hp=e98841618b0a3a10fd827cf3788b28dc2b4cffae;hpb=814b2d0009da73b56c6def5d70a9dd97c7b17e2e;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index e9884161..45c5a561 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -26,7 +26,7 @@ extern void APStartup(); // 16-bit AP startup code extern Uint GetEIP(); // start.asm extern Uint32 gaInitPageDir[1024]; // start.asm extern void Kernel_Stack_Top; -extern volatile int giThreadListLock; +extern tSpinlock glThreadListLock; extern int giNumCPUs; extern int giNextTID; extern int giTotalTickets; @@ -39,7 +39,7 @@ extern tThread *Threads_GetNextToRun(int CPU); extern void Threads_Dump(); extern tThread *Threads_CloneTCB(Uint *Err, Uint Flags); extern void Isr8(); // Double Fault -extern void Proc_AlterUserReturnAddr(); +extern void Proc_ReturnToUser(); // === PROTOTYPES === void ArchThreads_Init(); @@ -703,7 +703,7 @@ void Proc_CallFaultHandler(tThread *Thread) { // Rewinds the stack and calls the user function // Never returns - __asm__ __volatile__ ("mov %0, %%ebp;\n\tcall Proc_AlterUserReturnAddr" :: "r"(Thread->FaultHandler)); + __asm__ __volatile__ ("mov %0, %%ebp;\n\tcall Proc_ReturnToUser" :: "r"(Thread->FaultHandler)); for(;;); } @@ -717,7 +717,7 @@ void Proc_Scheduler(int CPU) tThread *thread; // If the spinlock is set, let it complete - if(giThreadListLock) return; + if(IS_LOCKED(&glThreadListLock)) return; // Clear Delete Queue while(gDeleteThreads)