summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-03-21 00:16:33 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-03-21 00:16:33 +0000
commita3d48a9639a06570044e4ee27fedc2e9d0c0be08 (patch)
tree8b995f8ba4d1cf4259d23a69864a8e3748293b93 /sys/arch
parentc234ab332b695092844a92b20e8ede659abb9011 (diff)
Add the bus_space_{read,write}_raw_multi_[248] extensions
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/include/bus.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/sys/arch/alpha/include/bus.h b/sys/arch/alpha/include/bus.h
index 854d055589b..01a2cb5a259 100644
--- a/sys/arch/alpha/include/bus.h
+++ b/sys/arch/alpha/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.5 1997/01/24 19:57:09 niklas Exp $ */
+/* $OpenBSD: bus.h,v 1.6 1997/03/21 00:16:32 niklas Exp $ */
/* $NetBSD: bus.h,v 1.10 1996/12/02 22:19:32 cgd Exp $ */
/*
@@ -240,6 +240,24 @@ struct alpha_bus_space {
/*
+ * void bus_space_read_raw_multi_N __P((bus_space_tag_t tag,
+ * bus_space_handle_t bsh, bus_size_t offset,
+ * u_int8_t *addr, size_t count));
+ *
+ * Read `count' bytes in 2, 4 or 8 byte wide quantities from bus space
+ * described by tag/handle/offset and copy into buffer provided. The buffer
+ * must have proper alignment for the N byte wide entities. Furthermore
+ * possible byte-swapping should be done by these functions.
+ */
+
+#define bus_space_read_raw_multi_2(t, h, o, a, c) \
+ bus_space_read_multi_2((t), (h), (o), (u_int16_t *)(a), (c) >> 1)
+#define bus_space_read_raw_multi_4(t, h, o, a, c) \
+ bus_space_read_multi_4((t), (h), (o), (u_int32_t *)(a), (c) >> 2)
+#define bus_space_read_raw_multi_8(t, h, o, a, c) \
+ bus_space_read_multi_8((t), (h), (o), (u_int64_t *)(a), (c) >> 4)
+
+/*
* Bus read region operations.
*/
#define bus_space_read_region_1(t, h, o, a, c) \
@@ -273,6 +291,23 @@ struct alpha_bus_space {
#define bus_space_write_multi_8(t, h, o, a, c) \
__abs_nonsingle(wm,8,(t),(h),(o),(a),(c))
+/*
+ * void bus_space_write_raw_multi_N __P((bus_space_tag_t tag,
+ * bus_space_handle_t bsh, bus_size_t offset,
+ * u_int8_t *addr, size_t count));
+ *
+ * Write `count' bytes in 2, 4 or 8 byte wide quantities from the buffer
+ * provided to bus space described by tag/handle/offset. The buffer
+ * must have proper alignment for the N byte wide entities. Furthermore
+ * possible byte-swapping should be done by these functions.
+ */
+
+#define bus_space_write_raw_multi_2(t, h, o, a, c) \
+ bus_space_write_multi_2((t), (h), (o), (u_int16_t *)(a), (c) >> 1)
+#define bus_space_write_raw_multi_4(t, h, o, a, c) \
+ bus_space_write_multi_4((t), (h), (o), (u_int32_t *)(a), (c) >> 2)
+#define bus_space_write_raw_multi_8(t, h, o, a, c) \
+ bus_space_write_multi_8((t), (h), (o), (u_int64_t *)(a), (c) >> 4)
/*
* Bus write region operations.