[SMP] SMP synchronization and scheduling

This commit is contained in:
2016-11-18 09:36:01 +01:00
parent 8961ae33eb
commit 474914ab1e
12 changed files with 69 additions and 18 deletions

16
kernel/cpu/sync.S Normal file
View File

@@ -0,0 +1,16 @@
.intel_syntax noprefix
.global spin_lock
spin_lock:
mov rdx, rdi
mov rax, 0x0
mov rcx, 0x1
.retry:
xor rax, rax
lock cmpxchg [rdx], cl
jnz .retry
ret
.global spin_unlock
spin_unlock:
movq [rdi], 0x0
ret