summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/include
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2008-08-25 14:05:52 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2008-08-25 14:05:52 +0000
commit7a0eafde30607d47e012a0e3673cf98b5d2ff1f6 (patch)
tree0929b1a7beebf76ea507a6693af936c6ca48d23d /sys/arch/sgi/include
parent2e8a13c965f15a718ac9d952c4d40137872392e2 (diff)
Add bus_space_read_raw_region_* and bus_space_write_raw_region_* bus space
accessors to OpenBSD/sgi. ok miod@
Diffstat (limited to 'sys/arch/sgi/include')
-rw-r--r--sys/arch/sgi/include/bus.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/sys/arch/sgi/include/bus.h b/sys/arch/sgi/include/bus.h
index 8b01655edc4..dfd9a7f615f 100644
--- a/sys/arch/sgi/include/bus.h
+++ b/sys/arch/sgi/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.10 2008/07/30 17:37:44 miod Exp $ */
+/* $OpenBSD: bus.h,v 1.11 2008/08/25 14:05:51 jsing Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
@@ -153,6 +153,25 @@ bus_space_read_region(4,32)
bus_space_read_region(8,64)
/*----------------------------------------------------------------------------*/
+#define bus_space_read_raw_region(n,m) \
+static __inline void \
+CAT(bus_space_read_raw_region_,n)(bus_space_tag_t bst, \
+ bus_space_handle_t bsh, \
+ bus_addr_t ba, u_int8_t *x, size_t cnt) \
+{ \
+ cnt >>= ((n) >> 1); \
+ while (cnt--) { \
+ CAT(bus_space_read_raw_multi_,n)(bst, bsh, ba, x, 1); \
+ ba += (n); \
+ x += (n); \
+ } \
+}
+
+bus_space_read_raw_region(2,16)
+bus_space_read_raw_region(4,32)
+bus_space_read_raw_region(8,64)
+
+/*----------------------------------------------------------------------------*/
#define bus_space_write_multi(n,m) \
static __inline void \
CAT(bus_space_write_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
@@ -186,6 +205,25 @@ bus_space_write_region(4,32)
bus_space_write_region(8,64)
/*----------------------------------------------------------------------------*/
+#define bus_space_write_raw_region(n,m) \
+static __inline void \
+CAT(bus_space_write_raw_region_,n)(bus_space_tag_t bst, \
+ bus_space_handle_t bsh, \
+ bus_addr_t ba, const u_int8_t *x, size_t cnt) \
+{ \
+ cnt >>= ((n) >> 1); \
+ while (cnt--) { \
+ CAT(bus_space_write_raw_multi_,n)(bst, bsh, ba, x, 1); \
+ ba += (n); \
+ x += (n); \
+ } \
+}
+
+bus_space_write_raw_region(2,16)
+bus_space_write_raw_region(4,32)
+bus_space_write_raw_region(8,64)
+
+/*----------------------------------------------------------------------------*/
#define bus_space_set_region(n,m) \
static __inline void \
CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \