diff options
author | jhb <jhb@FreeBSD.org> | 2005-10-24 20:52:26 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-10-24 20:52:26 +0000 |
commit | 3e00318de1032463a061de977e2d24d2c7f6bbce (patch) | |
tree | 7cd74f9528141c8c620def588b85253aa567773c /sys/amd64/amd64/apic_vector.S | |
parent | 2f00e0670ed16444e0faedcb9c2ec02736e72002 (diff) | |
download | FreeBSD-src-3e00318de1032463a061de977e2d24d2c7f6bbce.zip FreeBSD-src-3e00318de1032463a061de977e2d24d2c7f6bbce.tar.gz |
Use xchg in Xcpustop to close a race and make cpustop_restartfunc truly
one-shot in the SMP case (before using the simple mov / cmp / mov sequence
could allow multiple CPUs to execute the restart function on resume).
Diffstat (limited to 'sys/amd64/amd64/apic_vector.S')
-rw-r--r-- | sys/amd64/amd64/apic_vector.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S index 5d7685b..2e7e445 100644 --- a/sys/amd64/amd64/apic_vector.S +++ b/sys/amd64/amd64/apic_vector.S @@ -297,10 +297,11 @@ IDTVEC(cpustop) test %eax, %eax jnz 2f - movq cpustop_restartfunc, %rax + xorq %rax, %rax + lock + xchgq cpustop_restartfunc, %rax testq %rax, %rax jz 2f - movq $0, cpustop_restartfunc /* One-shot */ call *%rax 2: |