diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-09-29 18:54:40 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-09-29 18:54:40 +0000 |
commit | a2cee032ec1afe36876c84a6d3e297d71022838f (patch) | |
tree | c90e9fd6a8fd3e64954b624dc8a0a34eecf12f72 /sys/arch/octeon | |
parent | 67aac14886c5fb28e1445da5a9874ff7a03aa0c4 (diff) |
Proide a mips_sync() macro to wrap asm("sync"), and replace gazillions of
such statements with it.
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r-- | sys/arch/octeon/dev/octeon_intr.c | 9 | ||||
-rw-r--r-- | sys/arch/octeon/octeon/lock_machdep.c | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/arch/octeon/dev/octeon_intr.c b/sys/arch/octeon/dev/octeon_intr.c index 01dc7172788..4b8fab58dd7 100644 --- a/sys/arch/octeon/dev/octeon_intr.c +++ b/sys/arch/octeon/dev/octeon_intr.c @@ -144,7 +144,8 @@ octeon_splx(int newipl) /* Update masks to new ipl. Order highly important! */ __asm__ (".set noreorder\n"); ci->ci_ipl = newipl; - __asm__ ("sync\n\t.set reorder\n"); + mips_sync(); + __asm__ (".set reorder\n"); if (CPU_IS_PRIMARY(ci)) octeon_setintrmask(newipl); /* If we still have softints pending trigger processing. */ @@ -252,7 +253,8 @@ octeon_iointr(uint32_t hwpend, struct trap_frame *frame) __asm__ (".set noreorder\n"); ipl = ci->ci_ipl; - __asm__ ("sync\n\t.set reorder\n"); + mips_sync(); + __asm__ (".set reorder\n"); /* Service higher level interrupts first */ for (lvl = NIPLS - 1; lvl != IPL_NONE; lvl--) { @@ -293,7 +295,8 @@ octeon_iointr(uint32_t hwpend, struct trap_frame *frame) #endif __asm__ (".set noreorder\n"); ci->ci_ipl = ipl; - __asm__ ("sync\n\t.set reorder\n"); + mips_sync(); + __asm__ (".set reorder\n"); } if (rc == 0) printf("spurious interrupt %d\n", bitno); diff --git a/sys/arch/octeon/octeon/lock_machdep.c b/sys/arch/octeon/octeon/lock_machdep.c index 5d7198529e9..5aec43e79a1 100644 --- a/sys/arch/octeon/octeon/lock_machdep.c +++ b/sys/arch/octeon/octeon/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.1 2010/09/20 06:32:30 syuu Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.2 2012/09/29 18:54:38 miod Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -22,6 +22,7 @@ #include <sys/systm.h> #include <machine/atomic.h> +#include <machine/cpu.h> #include <machine/lock.h> #include <ddb/db_output.h> @@ -83,7 +84,7 @@ __mp_lock(struct __mp_lock *mpl) while (1) { sr = disableintr(); if (__cpu_cas(&mpl->mpl_count, 0, 1) == 0) { - __asm__ __volatile__ ("sync" ::: "memory"); + mips_sync(); mpl->mpl_cpu = ci; } @@ -113,7 +114,7 @@ __mp_unlock(struct __mp_lock *mpl) sr = disableintr(); if (--mpl->mpl_count == 1) { mpl->mpl_cpu = NULL; - __asm__ __volatile__ ("sync" ::: "memory"); + mips_sync(); mpl->mpl_count = 0; } @@ -135,7 +136,7 @@ __mp_release_all(struct __mp_lock *mpl) sr = disableintr(); mpl->mpl_cpu = NULL; - __asm__ __volatile__ ("sync" ::: "memory"); + mips_sync(); mpl->mpl_count = 0; setsr(sr); |