Add bus_space_read_raw_region_* and bus_space_write_raw_region_* bus space
authorjsing <jsing@openbsd.org>
Mon, 25 Aug 2008 14:05:51 +0000 (14:05 +0000)
committerjsing <jsing@openbsd.org>
Mon, 25 Aug 2008 14:05:51 +0000 (14:05 +0000)
accessors to OpenBSD/sgi.

ok miod@

sys/arch/sgi/include/bus.h

index 8b01655..dfd9a7f 100644 (file)
@@ -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.
@@ -152,6 +152,25 @@ bus_space_read_region(2,16)
 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                                                         \
@@ -185,6 +204,25 @@ bus_space_write_region(2,16)
 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                                                         \