diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-05-29 14:19:51 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-05-29 14:19:51 +0000 |
commit | 9fbf631ea4d32275e2a0b73042a7f5c42b84dddf (patch) | |
tree | 35a6f3a16e30d51a8bcd59b8df375c0d878e41b0 /sys/arch/i386 | |
parent | 3074148f150ad1764336ec65e48c9c96ac9404c9 (diff) |
Kill SPINLOCK_SPIN_HOOK, use CPU_BUSY_CYCLE() instead.
ok visa@, kettenis@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/lock_machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/pmap.c | 13 | ||||
-rw-r--r-- | sys/arch/i386/include/lock.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/npx.c | 5 |
4 files changed, 13 insertions, 17 deletions
diff --git a/sys/arch/i386/i386/lock_machdep.c b/sys/arch/i386/i386/lock_machdep.c index 92e9fe6e84c..0274c6f5461 100644 --- a/sys/arch/i386/i386/lock_machdep.c +++ b/sys/arch/i386/i386/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.24 2017/05/28 08:47:19 mpi Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.25 2017/05/29 14:19:49 mpi Exp $ */ /* $NetBSD: lock_machdep.c,v 1.1.2.3 2000/05/03 14:40:30 sommerfeld Exp $ */ /*- @@ -41,7 +41,7 @@ #include <sys/witness.h> #include <sys/_lock.h> -#include <machine/lock.h> +#include <machine/cpu.h> #include <machine/cpufunc.h> #include <ddb/db_output.h> @@ -69,12 +69,12 @@ __mp_lock_spin(struct __mp_lock *mpl, u_int me) { #ifndef MP_LOCKDEBUG while (mpl->mpl_ticket != me) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); #else int nticks = __mp_lock_spinout; while (mpl->mpl_ticket != me) { - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); if (--nticks <= 0) { db_printf("__mp_lock(%p): lock spun out", mpl); diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index 04248baa30d..b2345ce4e89 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.195 2016/10/21 06:20:58 mlarkin Exp $ */ +/* $OpenBSD: pmap.c,v 1.196 2017/05/29 14:19:49 mpi Exp $ */ /* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */ /* @@ -65,7 +65,6 @@ #include <uvm/uvm.h> -#include <machine/lock.h> #include <machine/cpu.h> #include <machine/specialreg.h> #include <machine/gdt.h> @@ -2520,7 +2519,7 @@ pmap_tlb_shootpage(struct pmap *pm, vaddr_t va) while (atomic_cas_uint(&tlb_shoot_wait, 0, wait) != 0) { while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } tlb_shoot_addr1 = va; CPU_INFO_FOREACH(cii, ci) { @@ -2558,7 +2557,7 @@ pmap_tlb_shootrange(struct pmap *pm, vaddr_t sva, vaddr_t eva) while (atomic_cas_uint(&tlb_shoot_wait, 0, wait) != 0) { while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } tlb_shoot_addr1 = sva; tlb_shoot_addr2 = eva; @@ -2596,7 +2595,7 @@ pmap_tlb_shoottlb(void) while (atomic_cas_uint(&tlb_shoot_wait, 0, wait) != 0) { while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } CPU_INFO_FOREACH(cii, ci) { @@ -2632,7 +2631,7 @@ pmap_tlb_droppmap(struct pmap *pm) while (atomic_cas_uint(&tlb_shoot_wait, 0, wait) != 0) { while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } CPU_INFO_FOREACH(cii, ci) { @@ -2654,7 +2653,7 @@ void pmap_tlb_shootwait(void) { while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } #else diff --git a/sys/arch/i386/include/lock.h b/sys/arch/i386/include/lock.h index 6fcd36b1ec6..2ea630a634d 100644 --- a/sys/arch/i386/include/lock.h +++ b/sys/arch/i386/include/lock.h @@ -1,10 +1,8 @@ -/* $OpenBSD: lock.h,v 1.12 2016/04/03 11:05:26 jsg Exp $ */ +/* $OpenBSD: lock.h,v 1.13 2017/05/29 14:19:49 mpi Exp $ */ /* public domain */ #ifndef _MACHINE_LOCK_H_ #define _MACHINE_LOCK_H_ -#define SPINLOCK_SPIN_HOOK __asm volatile("pause": : :"memory") - #endif /* _MACHINE_LOCK_H_ */ diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 2240838cf1d..782e0183670 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npx.c,v 1.61 2015/02/11 05:54:48 dlg Exp $ */ +/* $OpenBSD: npx.c,v 1.62 2017/05/29 14:19:50 mpi Exp $ */ /* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */ #if 0 @@ -61,7 +61,6 @@ #include <machine/trap.h> #include <machine/specialreg.h> #include <machine/i8259.h> -#include <machine/lock.h> #include <dev/isa/isareg.h> #include <dev/isa/isavar.h> @@ -875,7 +874,7 @@ npxsave_proc(struct proc *p, int save) i386_send_ipi(oci, save ? I386_IPI_SYNCH_FPU : I386_IPI_FLUSH_FPU); while (p->p_addr->u_pcb.pcb_fpcpu != NULL) - SPINLOCK_SPIN_HOOK; + CPU_BUSY_CYCLE(); } #else KASSERT(ci->ci_fpcurproc == p); |