diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/fpu.c | 25 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/lock_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 5 | ||||
-rw-r--r-- | sys/arch/amd64/include/lock.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/isa/npx.c | 17 |
5 files changed, 10 insertions, 44 deletions
diff --git a/sys/arch/amd64/amd64/fpu.c b/sys/arch/amd64/amd64/fpu.c index ae14f4a4a36..e9a5c0f748b 100644 --- a/sys/arch/amd64/amd64/fpu.c +++ b/sys/arch/amd64/amd64/fpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu.c,v 1.13 2007/11/12 14:47:56 millert Exp $ */ +/* $OpenBSD: fpu.c,v 1.14 2008/12/04 15:48:19 weingart Exp $ */ /* $NetBSD: fpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /*- @@ -59,6 +59,7 @@ #include <machine/trap.h> #include <machine/specialreg.h> #include <machine/fpu.h> +#include <machine/lock.h> #include <dev/isa/isareg.h> #include <dev/isa/isavar.h> @@ -311,28 +312,10 @@ fpusave_proc(struct proc *p, int save) fpusave_cpu(ci, save); splx(s); } else { -#ifdef DIAGNOSTIC - int spincount; -#endif - x86_send_ipi(oci, - save ? X86_IPI_SYNCH_FPU : X86_IPI_FLUSH_FPU); - -#ifdef DIAGNOSTIC - spincount = 0; -#endif + save ? X86_IPI_SYNCH_FPU : X86_IPI_FLUSH_FPU); while (p->p_addr->u_pcb.pcb_fpcpu != NULL) -#ifdef DIAGNOSTIC - { - spincount++; - if (spincount > 10000000) { - panic("fp_save ipi didn't"); - } - } -#else - __splbarrier(); /* XXX replace by generic barrier */ - ; -#endif + SPINLOCK_SPIN_HOOK; } #else KASSERT(ci->ci_fpcurproc == p); diff --git a/sys/arch/amd64/amd64/lock_machdep.c b/sys/arch/amd64/amd64/lock_machdep.c index f1740fae4e0..514fb6faf13 100644 --- a/sys/arch/amd64/amd64/lock_machdep.c +++ b/sys/arch/amd64/amd64/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.2 2007/11/27 15:55:29 art Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.3 2008/12/04 15:48:19 weingart Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -43,8 +43,6 @@ __mp_lock_init(struct __mp_lock *lock) extern int __mp_lock_spinout; #endif -#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory") - static __inline void __mp_lock_spin(struct __mp_lock *mpl) { diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index cf68c7d4218..6683435943a 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.32 2008/06/10 02:55:39 weingart Exp $ */ +/* $OpenBSD: pmap.c,v 1.33 2008/12/04 15:48:19 weingart Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -2485,9 +2485,6 @@ volatile long tlb_shoot_wait; volatile vaddr_t tlb_shoot_addr1; volatile vaddr_t tlb_shoot_addr2; -/* XXX */ -#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory") - void pmap_tlb_shootpage(struct pmap *pm, vaddr_t va) { diff --git a/sys/arch/amd64/include/lock.h b/sys/arch/amd64/include/lock.h index 34e57d53325..2dfd082f08c 100644 --- a/sys/arch/amd64/include/lock.h +++ b/sys/arch/amd64/include/lock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.h,v 1.4 2008/06/26 05:42:09 ray Exp $ */ +/* $OpenBSD: lock.h,v 1.5 2008/12/04 15:48:19 weingart Exp $ */ /* $NetBSD: lock.h,v 1.1.2.2 2000/05/03 14:40:55 sommerfeld Exp $ */ /*- @@ -51,6 +51,7 @@ typedef __volatile int __cpu_simple_lock_t; */ #define __lockbarrier() __asm __volatile("": : :"memory") +#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory"); #include <machine/atomic.h> diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index df1b2133c54..52aff615c11 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npx.c,v 1.43 2007/11/28 17:05:09 tedu Exp $ */ +/* $OpenBSD: npx.c,v 1.44 2008/12/04 15:48:19 weingart Exp $ */ /* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */ #if 0 @@ -812,27 +812,14 @@ npxsave_proc(struct proc *p, int save) npxsave_cpu(ci, save); splx(s); } else { -#ifdef DIAGNOSTIC - int spincount; -#endif - IPRINTF(("%s: fp ipi to %s %s %lx\n", ci->ci_dev.dv_xname, oci->ci_dev.dv_xname, save ? "save" : "flush", (u_long)p)); i386_send_ipi(oci, save ? I386_IPI_SYNCH_FPU : I386_IPI_FLUSH_FPU); -#ifdef DIAGNOSTIC - spincount = 0; -#endif - while (p->p_addr->u_pcb.pcb_fpcpu != NULL) { + while (p->p_addr->u_pcb.pcb_fpcpu != NULL) SPINLOCK_SPIN_HOOK; -#ifdef DIAGNOSTIC - if (spincount++ > 100000000) - panic("%s: fp_save ipi didn't (%s)", - ci->ci_dev.dv_xname, oci->ci_dev.dv_xname); -#endif - } } #else KASSERT(ci->ci_fpcurproc == p); |