Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm Add a defflag for __BUS_SPACE_HAS_STREAM_METHOD...
details: https://anonhg.NetBSD.org/src/rev/f8095e70eb65
branches: trunk
changeset: 553956:f8095e70eb65
user: scw <scw%NetBSD.org@localhost>
date: Thu Oct 23 15:03:24 2003 +0000
description:
Add a defflag for __BUS_SPACE_HAS_STREAM_METHODS, and add the
appropriate glue in bus.h, contingent on the option being defined.
This allows stream methods to be available on a port-by-port basis.
diffstat:
sys/arch/arm/conf/files.arm | 5 +-
sys/arch/arm/include/bus.h | 134 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 135 insertions(+), 4 deletions(-)
diffs (237 lines):
diff -r 4d78a365e45b -r f8095e70eb65 sys/arch/arm/conf/files.arm
--- a/sys/arch/arm/conf/files.arm Thu Oct 23 14:28:55 2003 +0000
+++ b/sys/arch/arm/conf/files.arm Thu Oct 23 15:03:24 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.arm,v 1.74 2003/09/11 18:54:31 scw Exp $
+# $NetBSD: files.arm,v 1.75 2003/10/23 15:03:24 scw Exp $
# temporary define to allow easy moving to ../arch/arm/arm32
defflag ARM32
@@ -20,6 +20,9 @@
# Interrupt implementation header definition.
defparam opt_arm_intr_impl.h ARM_INTR_IMPL
+# Board-specific bus_space(9) definitions
+defflag opt_arm_bus_space.h __BUS_SPACE_HAS_STREAM_METHODS
+
# Floating point emulator
defflag ARMFPE
file arch/arm/fpe-arm/armfpe_glue.S armfpe
diff -r 4d78a365e45b -r f8095e70eb65 sys/arch/arm/include/bus.h
--- a/sys/arch/arm/include/bus.h Thu Oct 23 14:28:55 2003 +0000
+++ b/sys/arch/arm/include/bus.h Thu Oct 23 15:03:24 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.h,v 1.11 2003/07/28 17:35:54 thorpej Exp $ */
+/* $NetBSD: bus.h,v 1.12 2003/10/23 15:03:24 scw Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -71,6 +71,10 @@
#ifndef _ARM32_BUS_H_
#define _ARM32_BUS_H_
+#if defined(_KERNEL) && !defined(_LKM)
+#include "opt_arm_bus_space.h"
+#endif
+
/*
* Addresses (in bus space).
*/
@@ -213,6 +217,67 @@
void (*bs_c_8) __P((void *, bus_space_handle_t, bus_size_t,
bus_space_handle_t, bus_size_t, bus_size_t));
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+ /* read stream (single) */
+ u_int8_t (*bs_r_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t));
+ u_int16_t (*bs_r_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t));
+ u_int32_t (*bs_r_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t));
+ u_int64_t (*bs_r_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t));
+
+ /* read multiple stream */
+ void (*bs_rm_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int8_t *, bus_size_t));
+ void (*bs_rm_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int16_t *, bus_size_t));
+ void (*bs_rm_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int32_t *, bus_size_t));
+ void (*bs_rm_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int64_t *, bus_size_t));
+
+ /* read region stream */
+ void (*bs_rr_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int8_t *, bus_size_t));
+ void (*bs_rr_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int16_t *, bus_size_t));
+ void (*bs_rr_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int32_t *, bus_size_t));
+ void (*bs_rr_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int64_t *, bus_size_t));
+
+ /* write stream (single) */
+ void (*bs_w_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int8_t));
+ void (*bs_w_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int16_t));
+ void (*bs_w_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int32_t));
+ void (*bs_w_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t, u_int64_t));
+
+ /* write multiple stream */
+ void (*bs_wm_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int8_t *, bus_size_t));
+ void (*bs_wm_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int16_t *, bus_size_t));
+ void (*bs_wm_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int32_t *, bus_size_t));
+ void (*bs_wm_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int64_t *, bus_size_t));
+
+ /* write region stream */
+ void (*bs_wr_1_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int8_t *, bus_size_t));
+ void (*bs_wr_2_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int16_t *, bus_size_t));
+ void (*bs_wr_4_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int32_t *, bus_size_t));
+ void (*bs_wr_8_s) __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int64_t *, bus_size_t));
+#endif /* __BUS_SPACE_HAS_STREAM_METHODS */
};
@@ -233,6 +298,19 @@
#define __bs_copy(sz, t, h1, o1, h2, o2, cnt) \
(*(t)->__bs_opname(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt)
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define __bs_opname_s(op,size) __bs_c(__bs_c(__bs_c(__bs_c(bs_,op),_),size),_s)
+#define __bs_rs_s(sz, t, h, o) \
+ (*(t)->__bs_opname_s(r,sz))((t)->bs_cookie, h, o)
+#define __bs_ws_s(sz, t, h, o, v) \
+ (*(t)->__bs_opname_s(w,sz))((t)->bs_cookie, h, o, v)
+#define __bs_nonsingle_s(type, sz, t, h, o, a, c) \
+ (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c)
+#define __bs_set_s(type, sz, t, h, o, v, c) \
+ (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, v, c)
+#define __bs_copy_s(sz, t, h1, o1, h2, o2, cnt) \
+ (*(t)->__bs_opname_s(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt)
+#endif
/*
* Mapping and unmapping operations.
@@ -282,6 +360,12 @@
#define bus_space_read_2(t, h, o) __bs_rs(2,(t),(h),(o))
#define bus_space_read_4(t, h, o) __bs_rs(4,(t),(h),(o))
#define bus_space_read_8(t, h, o) __bs_rs(8,(t),(h),(o))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t),(h),(o))
+#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t),(h),(o))
+#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t),(h),(o))
+#define bus_space_read_stream_8(t, h, o) __bs_rs_s(8,(t),(h),(o))
+#endif
/*
@@ -295,6 +379,16 @@
__bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_8(t, h, o, a, c) \
__bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_read_multi_stream_1(t, h, o, a, c) \
+ __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c))
+#define bus_space_read_multi_stream_2(t, h, o, a, c) \
+ __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c))
+#define bus_space_read_multi_stream_4(t, h, o, a, c) \
+ __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c))
+#define bus_space_read_multi_stream_8(t, h, o, a, c) \
+ __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c))
+#endif
/*
@@ -308,6 +402,16 @@
__bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_8(t, h, o, a, c) \
__bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_read_region_stream_1(t, h, o, a, c) \
+ __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c))
+#define bus_space_read_region_stream_2(t, h, o, a, c) \
+ __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c))
+#define bus_space_read_region_stream_4(t, h, o, a, c) \
+ __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c))
+#define bus_space_read_region_stream_8(t, h, o, a, c) \
+ __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c))
+#endif
/*
@@ -317,6 +421,12 @@
#define bus_space_write_2(t, h, o, v) __bs_ws(2,(t),(h),(o),(v))
#define bus_space_write_4(t, h, o, v) __bs_ws(4,(t),(h),(o),(v))
#define bus_space_write_8(t, h, o, v) __bs_ws(8,(t),(h),(o),(v))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_write_stream_1(t, h, o, v) __bs_ws_s(1,(t),(h),(o),(v))
+#define bus_space_write_stream_2(t, h, o, v) __bs_ws_s(2,(t),(h),(o),(v))
+#define bus_space_write_stream_4(t, h, o, v) __bs_ws_s(4,(t),(h),(o),(v))
+#define bus_space_write_stream_8(t, h, o, v) __bs_ws_s(8,(t),(h),(o),(v))
+#endif
/*
@@ -330,6 +440,16 @@
__bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_8(t, h, o, a, c) \
__bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_write_multi_stream_1(t, h, o, a, c) \
+ __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c))
+#define bus_space_write_multi_stream_2(t, h, o, a, c) \
+ __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c))
+#define bus_space_write_multi_stream_4(t, h, o, a, c) \
+ __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c))
+#define bus_space_write_multi_stream_8(t, h, o, a, c) \
+ __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c))
+#endif
/*
@@ -343,6 +463,16 @@
__bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
#define bus_space_write_region_8(t, h, o, a, c) \
__bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+#define bus_space_write_region_stream_1(t, h, o, a, c) \
+ __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c))
+#define bus_space_write_region_stream_2(t, h, o, a, c) \
+ __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c))
+#define bus_space_write_region_stream_4(t, h, o, a, c) \
+ __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c))
+#define bus_space_write_region_stream_8(t, h, o, a, c) \
+ __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c))
+#endif
/*
@@ -357,7 +487,6 @@
#define bus_space_set_multi_8(t, h, o, v, c) \
__bs_set(sm,8,(t),(h),(o),(v),(c))
-
/*
* Set region operations.
*/
@@ -370,7 +499,6 @@
#define bus_space_set_region_8(t, h, o, v, c) \
__bs_set(sr,8,(t),(h),(o),(v),(c))
-
/*
* Copy operations.
*/
Home |
Main Index |
Thread Index |
Old Index