ke/amd64: use movb instead of xchg

This commit is contained in:
Loïc Grégoire
2026-10-24 19:01:45 -04:00
parent b9261c84de
commit 664b621a16
+4 -8
View File
@@ -150,12 +150,10 @@ amd64_context_switch:
mov (%rsi), %rsp mov (%rsi), %rsp
/* Set switching to false. */ /* Set switching to false. */
xorl %eax, %eax movb $0, (%rcx)
xchgb %al, (%rcx)
/* Unlock passed lock. */ /* Unlock passed lock. */
xorl %eax, %eax movb $0, (%rdx)
xchgb %al, (%rdx)
/* Restore callee-saved registers. */ /* Restore callee-saved registers. */
pop %rbp pop %rbp
@@ -196,12 +194,10 @@ amd64_context_switch_cont_n:
call ki_free_old_stack call ki_free_old_stack
/* Set switching to false. */ /* Set switching to false. */
xorl %eax, %eax movb $0, (%r13)
xchgb %al, (%r13)
/* Unlock passed lock. */ /* Unlock passed lock. */
xorl %eax, %eax movb $0, (%r12)
xchgb %al, (%r12)
/* Restore callee-saved registers. */ /* Restore callee-saved registers. */
pop %rbp pop %rbp