summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-02-21 10:59:17 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-02-21 10:59:17 +0000
commit642d2a88720ae533d337ec926445e35ce5816d1b (patch)
tree9eb4fffc0a371ebebef19521371c7c1436a7c5d4
parent8f71eff229d88f022578d0813d555ea635dbe509 (diff)
add bus_space_{read,write}_region_* + some KNF
-rw-r--r--sys/arch/amiga/include/bus.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/sys/arch/amiga/include/bus.h b/sys/arch/amiga/include/bus.h
index b7bb10dcce5..2bba681b4cf 100644
--- a/sys/arch/amiga/include/bus.h
+++ b/sys/arch/amiga/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.3 1996/11/28 23:33:05 niklas Exp $ */
+/* $OpenBSD: bus.h,v 1.4 1997/02/21 10:59:16 niklas Exp $ */
/*
* Copyright (c) 1996 Niklas Hallqvist.
@@ -54,7 +54,7 @@ struct amiga_bus_space {
void *bs_data;
int (*bs_map)(bus_space_tag_t, bus_addr_t, bus_size_t, int,
- bus_space_handle_t *);
+ bus_space_handle_t *);
int (*bs_unmap)(bus_space_tag_t, bus_space_handle_t, bus_size_t);
/* We need swapping of 16-bit entities */
@@ -113,6 +113,23 @@ bus_space_read_multi(4,32)
#define bus_space_read_multi_8 !!! bus_space_read_multi_8 not implemented !!!
+#define bus_space_read_region(n, m) \
+static __inline void \
+CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
+ bus_addr_t ba, CAT3(u_int,m,_t) *buf, bus_size_t cnt) \
+{ \
+ while (cnt--) { \
+ *buf++ = CAT(bus_space_read_,n)(bst, bsh, ba); \
+ ba += n; \
+ } \
+}
+
+bus_space_read_region(1,8)
+bus_space_read_region(2,16)
+bus_space_read_region(4,32)
+
+#define bus_space_read_region_8 !!! bus_space_read_region_8 not implemented !!!
+
static __inline void
bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_addr_t ba,
u_int8_t x)
@@ -153,6 +170,24 @@ bus_space_write_multi(4,32)
#define bus_space_write_multi_8 !!! bus_space_write_multi_8 not implemented !!!
+#define bus_space_write_region(n, m) \
+static __inline void \
+CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
+ bus_addr_t ba, const CAT3(u_int,m,_t) *buf, bus_size_t cnt) \
+{ \
+ while (cnt--) { \
+ CAT(bus_space_write_,n)(bst, bsh, ba, *buf++); \
+ ba += n; \
+ } \
+}
+
+bus_space_write_region(1,8)
+bus_space_write_region(2,16)
+bus_space_write_region(4,32)
+
+#define bus_space_write_region_8 \
+ !!! bus_space_write_region_8 not implemented !!!
+
/* OpenBSD extensions */
static __inline void
bus_space_read_raw_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh,