Kernel/x86 - Fixing build
authorJohn Hodge <[email protected]>
Wed, 7 Dec 2011 11:30:05 +0000 (19:30 +0800)
committerJohn Hodge <[email protected]>
Wed, 7 Dec 2011 11:30:05 +0000 (19:30 +0800)
Kernel/arch/x86/lib.c
Kernel/arch/x86/proc.c

index 0471deb..3858eff 100644 (file)
@@ -82,9 +82,12 @@ void SHORTLOCK(struct sShortSpinlock *Lock)
        __ASM__("cli");
        
        // Wait for another CPU to release
-       while(v) {
-               __ASM__("xchgl %%eax, (%%edi)":"=a"(v):"a"(cpu),"D"(&Lock->Lock));
-       }
+       __ASM__(
+               "1: lock cmpxchgl %2, (%3)\n\t"
+               "jnz 1b"
+               : "=a"(v)
+               : "a"(0), "r"(cpu), "r"(&Lock->Lock)
+               );
        
        Lock->IF = IF;
        
index 9e8aa38..1cd1106 100644 (file)
@@ -488,7 +488,7 @@ void Proc_Start(void)
        #else
        // Create Idle Task
        tid = Proc_NewKThread(Proc_IdleThread, &gaCPUs[0]);
-       gaCPUs[0].IdleThread = Threads_GetThread(tid);
+//     gaCPUs[0].IdleThread = Threads_GetThread(tid);
        
        // Set current task
        gaCPUs[0].Current = &gThreadZero;

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