Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/prep Use new common bus.h framework.



details:   https://anonhg.NetBSD.org/src/rev/64c9d68c37a8
branches:  trunk
changeset: 511253:64c9d68c37a8
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Jun 15 15:50:04 2001 +0000

description:
Use new common bus.h framework.

diffstat:

 sys/arch/prep/conf/files.prep       |     3 +-
 sys/arch/prep/include/bus.h         |  1047 +----------------------------------
 sys/arch/prep/include/isa_machdep.h |    11 +-
 sys/arch/prep/include/pci_machdep.h |     4 +-
 sys/arch/prep/isa/isadma_machdep.c  |    66 +-
 sys/arch/prep/pci/pci_machdep.c     |     6 +-
 sys/arch/prep/pci/pcib.c            |    15 +-
 sys/arch/prep/prep/bus_dma.c        |   627 --------------------
 sys/arch/prep/prep/bus_space.c      |    40 +-
 sys/arch/prep/prep/mainbus.c        |    12 +-
 10 files changed, 91 insertions(+), 1740 deletions(-)

diffs (truncated from 2151 to 300 lines):

diff -r 7dd60cd91b87 -r 64c9d68c37a8 sys/arch/prep/conf/files.prep
--- a/sys/arch/prep/conf/files.prep     Fri Jun 15 15:24:03 2001 +0000
+++ b/sys/arch/prep/conf/files.prep     Fri Jun 15 15:50:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.prep,v 1.16 2001/01/23 14:12:25 nonaka Exp $
+#      $NetBSD: files.prep,v 1.17 2001/06/15 15:50:04 nonaka Exp $
 #
 # prep-specific configuration info
 #
@@ -7,7 +7,6 @@
 maxusers 2 8 64
 
 file   arch/prep/prep/autoconf.c
-file   arch/prep/prep/bus_dma.c
 file   arch/prep/prep/bus_space.c
 file   arch/prep/prep/clock.c
 file   arch/prep/prep/conf.c
diff -r 7dd60cd91b87 -r 64c9d68c37a8 sys/arch/prep/include/bus.h
--- a/sys/arch/prep/include/bus.h       Fri Jun 15 15:24:03 2001 +0000
+++ b/sys/arch/prep/include/bus.h       Fri Jun 15 15:50:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.5 2001/03/07 22:42:20 thorpej Exp $  */
+/*     $NetBSD: bus.h,v 1.6 2001/06/15 15:50:05 nonaka Exp $   */
 /*     $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $    */
 
 /*-
@@ -104,7 +104,7 @@
 #ifndef _PREP_BUS_H_
 #define _PREP_BUS_H_
 
-#include <machine/pio.h>
+#include <powerpc/bus.h>
 
 /*
  * Values for the Be bus space tag, not to be used directly by MI code.
@@ -119,1044 +119,9 @@
 #define PHYS_TO_PCI_MEM(x)     ((x) | MPC105_DIRECT_MAPPED_SPACE)
 #define PCI_MEM_TO_PHYS(x)     ((x) & ~MPC105_DIRECT_MAPPED_SPACE)
 
-/*
- * Bus access types.
- */
-typedef u_int32_t bus_addr_t;
-typedef u_int32_t bus_size_t;
-typedef        u_int32_t bus_space_handle_t;
-typedef        const struct prep_bus_space {
-       u_int32_t pbs_type;
-       bus_addr_t pbs_base;
-       bus_addr_t pbs_limit;
-} *bus_space_tag_t;
-
-extern const struct prep_bus_space prep_io_space_tag;
-extern const struct prep_bus_space prep_isa_io_space_tag;
-extern const struct prep_bus_space prep_mem_space_tag;
-extern const struct prep_bus_space prep_isa_mem_space_tag;
-
-#define BUS_SPACE_MAP_CACHEABLE         0x01
-#define BUS_SPACE_MAP_LINEAR            0x02
-#define        BUS_SPACE_MAP_PREFETCHABLE      0x04
-
-#ifdef __STDC__
-#define CAT(a,b)       a##b
-#define CAT3(a,b,c)    a##b##c
-#else
-#define CAT(a,b)       a/**/b
-#define CAT3(a,b,c)    a/**/b/**/c
-#endif
-
-/*
- * Access methods for bus resources
- */
-
-#define        __BUS_SPACE_HAS_STREAM_METHODS
-
-/*
- *     int bus_space_map  __P((bus_space_tag_t t, bus_addr_t addr,
- *         bus_size_t size, int flags, bus_space_handle_t *bshp));
- *
- * Map a region of bus space.
- */
-
-int    prep_memio_map __P((bus_space_tag_t t, bus_addr_t addr,
-           bus_size_t size, int flags, bus_space_handle_t *bshp));
-
-#define bus_space_map(t, a, s, f, hp)                                  \
-    prep_memio_map((t), (a), (s), (f), (hp))
-
-/*
- *     int bus_space_unmap __P((bus_space_tag_t t,
- *         bus_space_handle_t bsh, bus_size_t size));
- *
- * Unmap a region of bus space.
- */
-
-void   prep_memio_unmap __P((bus_space_tag_t t, bus_space_handle_t bsh,
-           bus_size_t size));
-
-#define bus_space_unmap(t, h, s)                                       \
-    prep_memio_unmap((t), (h), (s))
-
-/*
- *     int bus_space_subregion __P((bus_space_tag_t t,
- *         bus_space_handle_t bsh, bus_size_t offset, bus_size_t size,
- *         bus_space_handle_t *nbshp));
- *
- * Get a new handle for a subregion of an already-mapped area of bus space.
- */
-
-#define bus_space_subregion(t, h, o, s, hp)                            \
-    ((*(hp) = (h) + (o)), 0)
-
-/*
- *     int bus_space_alloc __P((bus_space_tag_t t, bus_addr_t rstart,
- *         bus_addr_t rend, bus_size_t size, bus_size_t align,
- *         bus_size_t boundary, int flags, bus_addr_t *bpap,
- *         bus_space_handle_t *bshp));
- *
- * Allocate a region of bus space.
- */
-
-int    prep_memio_alloc __P((bus_space_tag_t t, bus_addr_t rstart,
-           bus_addr_t rend, bus_size_t size, bus_size_t align,
-           bus_size_t boundary, int flags, bus_addr_t *bpap,
-           bus_space_handle_t *bshp));
-
-#define bus_space_alloc(t, rs, re, s, a, b, f, ap, hp)                 \
-    prep_memio_alloc((t), (rs), (re), (s), (a), (b), (f), (ap), (hp))
-
-/*
- *     int bus_space_free __P((bus_space_tag_t t,
- *         bus_space_handle_t bsh, bus_size_t size));
- *
- * Free a region of bus space.
- */
-
-void   prep_memio_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
-           bus_size_t size));
-
-#define        bus_space_free(t, h, s)                                         \
-    prep_memio_free((t), (h), (s))
-
-/*
- *     u_intN_t bus_space_read_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset));
- *
- * Read a 1, 2, 4, or 8 byte quantity from bus space
- * described by tag/handle/offset.
- */
-
-#define bus_space_read(n,m)                                                  \
-static __inline CAT3(u_int,m,_t)                                             \
-CAT(bus_space_read_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,          \
-     bus_size_t offset)                                                              \
-{                                                                            \
-       return CAT3(in,m,rb)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)));  \
-}
-
-bus_space_read(1,8)
-bus_space_read(2,16)
-bus_space_read(4,32)
-#define        bus_space_read_8        !!! bus_space_read_8 unimplemented !!!
-
-/*
- *     u_intN_t bus_space_read_stream_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset));
- *
- * Read a 2, 4, or 8 byte stream quantity from bus space
- * described by tag/handle/offset.
- */
-
-#define bus_space_read_stream(n,m)                                           \
-static __inline CAT3(u_int,m,_t)                                             \
-CAT(bus_space_read_stream_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,    \
-     bus_size_t offset)                                                              \
-{                                                                            \
-       return CAT(in,m)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)));  \
-}
-
-bus_space_read_stream(2,16)
-bus_space_read_stream(4,32)
-#define        bus_space_read_stream_8 !!! bus_space_read_stream_8 unimplemented !!!
-
-/*
- *     void bus_space_read_multi_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         u_intN_t *addr, size_t count));
- *
- * Read `count' 1, 2, 4, or 8 byte quantities from bus space
- * described by tag/handle/offset and copy into buffer provided.
- */
-
-#define bus_space_read_multi(n,m)                                            \
-static __inline void                                                         \
-CAT(bus_space_read_multi_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,     \
-     bus_size_t offset, CAT3(u_int,m,_t) *addr, size_t count)                \
-{                                                                            \
-       CAT3(ins,m,rb)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)),         \
-           (CAT3(u_int,m,_t) *)addr, (size_t)count);                         \
-}
-
-bus_space_read_multi(1,8)
-bus_space_read_multi(2,16)
-bus_space_read_multi(4,32)
-#define        bus_space_read_multi_8  !!! bus_space_read_multi_8 not implemented !!!
-
-/*
- *     void bus_space_read_multi_stream_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         u_intN_t *addr, size_t count));
- *
- * Read `count' 2, 4, or 8 byte stream quantities from bus space
- * described by tag/handle/offset and copy into buffer provided.
- */
-
-#define bus_space_read_multi_stream(n,m)                                     \
-static __inline void                                                         \
-CAT(bus_space_read_multi_stream_,n)(bus_space_tag_t tag,                     \
-     bus_space_handle_t bsh,                                                 \
-     bus_size_t offset, CAT3(u_int,m,_t) *addr, size_t count)                \
-{                                                                            \
-       CAT(ins,m)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)),             \
-           (CAT3(u_int,m,_t) *)addr, (size_t)count);                         \
-}
-
-bus_space_read_multi_stream(2,16)
-bus_space_read_multi_stream(4,32)
-#define        bus_space_read_multi_stream_8                                         \
-       !!! bus_space_read_multi_stream_8 not implemented !!!
-
-/*
- *     void bus_space_write_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         u_intN_t value));
- *
- * Write the 1, 2, 4, or 8 byte value `value' to bus space
- * described by tag/handle/offset.
- */
-
-#define bus_space_write(n,m)                                                 \
-static __inline void                                                         \
-CAT(bus_space_write_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,         \
-     bus_size_t offset, CAT3(u_int,m,_t) x)                                  \
-{                                                                            \
-       CAT3(out,m,rb)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)), x);     \
-}
-
-bus_space_write(1,8)
-bus_space_write(2,16)
-bus_space_write(4,32)
-#define        bus_space_write_8       !!! bus_space_write_8 unimplemented !!!
-
-/*
- *     void bus_space_write_stream_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         u_intN_t value));
- *
- * Write the 2, 4, or 8 byte stream value `value' to bus space
- * described by tag/handle/offset.
- */
-
-#define bus_space_write_stream(n,m)                                          \
-static __inline void                                                         \
-CAT(bus_space_write_stream_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,   \
-     bus_size_t offset, CAT3(u_int,m,_t) x)                                  \
-{                                                                            \
-       CAT(out,m)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)), x);     \
-}
-
-bus_space_write_stream(2,16)
-bus_space_write_stream(4,32)
-#define        bus_space_write_stream_8 !!! bus_space_write_stream_8 unimplemented !!!
-
-/*
- *     void bus_space_write_multi_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         const u_intN_t *addr, size_t count));
- *
- * Write `count' 1, 2, 4, or 8 byte quantities from the buffer
- * provided to bus space described by tag/handle/offset.
- */
-
-#define bus_space_write_multi(n,m)                                           \
-static __inline void                                                         \
-CAT(bus_space_write_multi_,n)(bus_space_tag_t tag, bus_space_handle_t bsh,    \
-     bus_size_t offset, const CAT3(u_int,m,_t) *addr, size_t count)          \
-{                                                                            \
-       CAT3(outs,m,rb)((volatile CAT3(u_int,m,_t) *)(bsh + (offset)),        \
-           (CAT3(u_int,m,_t) *)addr, (size_t)count);                         \
-}
-
-bus_space_write_multi(1,8)
-bus_space_write_multi(2,16)
-bus_space_write_multi(4,32)
-#define        bus_space_write_multi_8 !!! bus_space_write_multi_8 not implemented !!!
-
-/*
- *     void bus_space_write_multi_stream_N __P((bus_space_tag_t tag,
- *         bus_space_handle_t bsh, bus_size_t offset,
- *         const u_intN_t *addr, size_t count));
- *



Home | Main Index | Thread Index | Old Index