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/i386 | |
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/i386')
-rw-r--r-- | sys/i386/i386/apic_vector.s | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s index 99b765f..e8f6f9d 100644 --- a/sys/i386/i386/apic_vector.s +++ b/sys/i386/i386/apic_vector.s @@ -340,10 +340,11 @@ IDTVEC(cpustop) test %eax, %eax jnz 2f - movl CNAME(cpustop_restartfunc), %eax + xorl %eax, %eax + lock + xchgl CNAME(cpustop_restartfunc), %eax test %eax, %eax jz 2f - movl $0, CNAME(cpustop_restartfunc) /* One-shot */ call *%eax 2: |