From 01f267a321fe2e72dec65801b9a1d868cee89715 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 2 Feb 2023 15:49:00 +0200 Subject: [PATCH] Kernel: fix spinlock for i386 --- kernel/arch/i386/SpinLock.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/arch/i386/SpinLock.S b/kernel/arch/i386/SpinLock.S index b1ffc3717a..8d803d82c4 100644 --- a/kernel/arch/i386/SpinLock.S +++ b/kernel/arch/i386/SpinLock.S @@ -1,17 +1,19 @@ .global spinlock_lock_asm spinlock_lock_asm: - lock; btsl $0, (%edi) + movl 4(%esp), %eax + lock; btsl $0, (%eax) jnc .done .retry: pause - testl $1, (%edi) + testl $1, (%eax) jne .retry - lock; btsl $0, (%edi) + lock; btsl $0, (%eax) jc .retry .done: ret .global spinlock_unlock_asm spinlock_unlock_asm: - movl $0, (%edi) + movl 4(%esp), %eax + movl $0, (%eax) ret \ No newline at end of file