summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-01-22 23:56:32 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-01-22 23:56:32 +0000
commitfbec280712c8c4b38d4c35baef57e9c86efe7f00 (patch)
treee01667f1c057fec19f64517e805fbb2b8f59191e /sys/arch
parent9bbaf662bc618bbfed9c8ebda6ca972f1cac3b5c (diff)
pull the guts of bus_space_barrier into the inline function in the header.
there's only one implementation of it on sparc64, so we shouldnt need to iterate up a chain of bus_space_tags to get to it. because the only argument that is used inside the function is the flags, this can generally be inlined to a single membar opcode. this leaves that op as membar(Sync) for now while kettenis@ thinks about what changing it might mean. ok miod@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/include/bus.h36
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c18
2 files changed, 23 insertions, 31 deletions
diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h
index 451cf51a519..fd8119eead2 100644
--- a/sys/arch/sparc64/include/bus.h
+++ b/sys/arch/sparc64/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.27 2011/09/27 20:47:30 miod Exp $ */
+/* $OpenBSD: bus.h,v 1.28 2013/01/22 23:56:31 dlg Exp $ */
/* $NetBSD: bus.h,v 1.31 2001/09/21 15:30:41 wiz Exp $ */
/*-
@@ -197,11 +197,6 @@ struct sparc_bus_space_tag {
bus_space_handle_t, bus_size_t,
bus_size_t, bus_space_handle_t *);
- void (*sparc_bus_barrier)(bus_space_tag_t,
- bus_space_tag_t,
- bus_space_handle_t, bus_size_t,
- bus_size_t, int);
-
paddr_t (*sparc_bus_mmap)(bus_space_tag_t,
bus_space_tag_t,
bus_addr_t, off_t, int, int);
@@ -309,6 +304,10 @@ void bus_space_render_tag(bus_space_tag_t, char*, size_t);
#define _BS_CALL(t,f) \
(*(t)->f)
+/* flags for bus_space_barrier() */
+#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */
+#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */
+
static inline void
bus_space_barrier(t, h, o, s, f)
bus_space_tag_t t;
@@ -317,10 +316,23 @@ bus_space_barrier(t, h, o, s, f)
bus_size_t s;
int f;
{
- const bus_space_tag_t t0 = t;
- _BS_PRECALL(t, sparc_bus_barrier);
- _BS_CALL(t, sparc_bus_barrier)(t, t0, h, o, s, f);
- _BS_POSTCALL;
+#ifdef notyet
+ switch (f) {
+ case (BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE):
+ membar(LoadLoad|StoreStore);
+ break;
+ case BUS_SPACE_BARRIER_READ:
+ membar(LoadLoad);
+ break;
+ case BUS_SPACE_BARRIER_WRITE:
+ membar(StoreStore);
+ break;
+ default:
+ break;
+ }
+#else
+ membar(Sync);
+#endif
}
#include <sparc64/sparc64/busop.h>
@@ -341,10 +353,6 @@ bus_space_barrier(t, h, o, s, f)
#define BUS_INTR_ESTABLISH_FASTTRAP 1
#define BUS_INTR_ESTABLISH_SOFTINTR 2
-/* flags for bus_space_barrier() */
-#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */
-#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */
-
/*
* Flags used in various bus DMA methods.
*/
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 0eb58e4aaba..4874788a991 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.144 2012/12/22 17:26:46 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.145 2013/01/22 23:56:31 dlg Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -1581,8 +1581,6 @@ paddr_t sparc_bus_mmap(bus_space_tag_t, bus_space_tag_t, bus_addr_t, off_t,
int, int);
void *sparc_mainbus_intr_establish(bus_space_tag_t, bus_space_tag_t, int, int,
int, int (*)(void *), void *, const char *);
-void sparc_bus_barrier(bus_space_tag_t, bus_space_tag_t, bus_space_handle_t,
- bus_size_t, bus_size_t, int);
int sparc_bus_alloc(bus_space_tag_t, bus_space_tag_t, bus_addr_t, bus_addr_t,
bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *,
bus_space_handle_t *);
@@ -1837,19 +1835,6 @@ sparc_mainbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int number,
return (ih);
}
-void
-sparc_bus_barrier(bus_space_tag_t t, bus_space_tag_t t0, bus_space_handle_t h,
- bus_size_t offset, bus_size_t size, int flags)
-{
- /*
- * We have lots of alternatives depending on whether we're
- * synchronizing loads with loads, loads with stores, stores
- * with loads, or stores with stores. The only ones that seem
- * generic are #Sync and #MemIssue. I'll use #Sync for safety.
- */
- membar(Sync);
-}
-
int
sparc_bus_alloc(bus_space_tag_t t, bus_space_tag_t t0, bus_addr_t rs,
bus_addr_t re, bus_size_t s, bus_size_t a, bus_size_t b, int f,
@@ -1878,7 +1863,6 @@ static const struct sparc_bus_space_tag _mainbus_space_tag = {
sparc_bus_protect, /* bus_space_protect */
sparc_bus_unmap, /* bus_space_unmap */
sparc_bus_subregion, /* bus_space_subregion */
- sparc_bus_barrier, /* bus_space_barrier */
sparc_bus_mmap, /* bus_space_mmap */
sparc_mainbus_intr_establish, /* bus_intr_establish */
sparc_bus_addr /* bus_space_addr */