mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
ke/amd64: use movb instead of xchg
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user