Source-Changes-HG archive

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

[src/trunk]: src Change <machine/bus.h> to <sys/bus.h> throughout.



details:   https://anonhg.NetBSD.org/src/rev/29b142fa00ff
branches:  trunk
changeset: 767474:29b142fa00ff
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Jul 19 15:44:52 2011 +0000

description:
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark evbsh3/bus.h obsolete.

diffstat:

 distrib/sets/lists/comp/md.evbsh3            |    4 +-
 sys/arch/evbsh3/ap_ms104_sh4/if_sm_mainbus.c |    6 +-
 sys/arch/evbsh3/evbsh3/bus_dma.c             |    8 +-
 sys/arch/evbsh3/evbsh3/machdep.c             |    6 +-
 sys/arch/evbsh3/include/Makefile             |    4 +-
 sys/arch/evbsh3/include/bus.h                |  708 ---------------------------
 sys/arch/evbsh3/include/bus_defs.h           |  419 +++++++++++++++
 sys/arch/evbsh3/include/bus_funcs.h          |  366 +++++++++++++
 sys/arch/evbsh3/t_sh7706lan/if_ne_mainbus.c  |    4 +-
 9 files changed, 801 insertions(+), 724 deletions(-)

diffs (truncated from 1663 to 300 lines):

diff -r 2704177e2083 -r 29b142fa00ff distrib/sets/lists/comp/md.evbsh3
--- a/distrib/sets/lists/comp/md.evbsh3 Tue Jul 19 15:37:38 2011 +0000
+++ b/distrib/sets/lists/comp/md.evbsh3 Tue Jul 19 15:44:52 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbsh3,v 1.27 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.evbsh3,v 1.28 2011/07/19 15:44:52 dyoung Exp $
 ./usr/include/evbsh3                           comp-c-include
 ./usr/include/evbsh3/_G_config.h               comp-obsolete           obsolete
 ./usr/include/evbsh3/ansi.h                    comp-c-include
@@ -6,7 +6,7 @@
 ./usr/include/evbsh3/asm.h                     comp-c-include
 ./usr/include/evbsh3/bootinfo.h                        comp-obsolete           obsolete
 ./usr/include/evbsh3/bswap.h                   comp-c-include
-./usr/include/evbsh3/bus.h                     comp-c-include
+./usr/include/evbsh3/bus.h                     comp-obsolete           obsolete
 ./usr/include/evbsh3/cdefs.h                   comp-c-include
 ./usr/include/evbsh3/coff_machdep.h            comp-c-include
 ./usr/include/evbsh3/conf.h                    comp-obsolete           obsolete
diff -r 2704177e2083 -r 29b142fa00ff sys/arch/evbsh3/ap_ms104_sh4/if_sm_mainbus.c
--- a/sys/arch/evbsh3/ap_ms104_sh4/if_sm_mainbus.c      Tue Jul 19 15:37:38 2011 +0000
+++ b/sys/arch/evbsh3/ap_ms104_sh4/if_sm_mainbus.c      Tue Jul 19 15:44:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sm_mainbus.c,v 1.1 2010/04/06 15:54:29 nonaka Exp $ */
+/*     $NetBSD: if_sm_mainbus.c,v 1.2 2011/07/19 15:44:52 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2009 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -27,11 +27,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sm_mainbus.c,v 1.1 2010/04/06 15:54:29 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sm_mainbus.c,v 1.2 2011/07/19 15:44:52 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
+#include <sys/bus.h>
 
 #include <net/if.h>
 #include <net/if_ether.h>
@@ -39,7 +40,6 @@
 
 #include <machine/autoconf.h>
 #include <machine/intr.h>
-#include <machine/bus.h>
 
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
diff -r 2704177e2083 -r 29b142fa00ff sys/arch/evbsh3/evbsh3/bus_dma.c
--- a/sys/arch/evbsh3/evbsh3/bus_dma.c  Tue Jul 19 15:37:38 2011 +0000
+++ b/sys/arch/evbsh3/evbsh3/bus_dma.c  Tue Jul 19 15:44:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.2 2010/11/12 13:18:57 uebayasi Exp $     */
+/*     $NetBSD: bus_dma.c,v 1.3 2011/07/19 15:44:52 dyoung Exp $       */
 
 /*
  * Copyright (c) 2005 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.2 2010/11/12 13:18:57 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.3 2011/07/19 15:44:52 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -34,14 +34,14 @@
 #include <sys/device.h>
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
+#define        _EVBSH3_BUS_DMA_PRIVATE
+#include <sys/bus.h>
 
 #include <uvm/uvm.h>
 
 #include <sh3/cache.h>
 
 #include <machine/autoconf.h>
-#define        _EVBSH3_BUS_DMA_PRIVATE
-#include <machine/bus.h>
 
 #if defined(DEBUG) && defined(BUSDMA_DEBUG)
 int busdma_debug = 0;
diff -r 2704177e2083 -r 29b142fa00ff sys/arch/evbsh3/evbsh3/machdep.c
--- a/sys/arch/evbsh3/evbsh3/machdep.c  Tue Jul 19 15:37:38 2011 +0000
+++ b/sys/arch/evbsh3/evbsh3/machdep.c  Tue Jul 19 15:44:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.73 2011/01/19 09:36:33 he Exp $  */
+/*     $NetBSD: machdep.c,v 1.74 2011/07/19 15:44:52 dyoung Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2011/01/19 09:36:33 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2011/07/19 15:44:52 dyoung Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -82,6 +82,7 @@
 #include <sys/sysctl.h>
 #include <sys/ksyms.h>
 #include <sys/device.h>
+#include <sys/bus.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -93,7 +94,6 @@
 #include <sh3/cache_sh4.h>
 #include <sh3/exception.h>
 
-#include <machine/bus.h>
 #include <machine/intr.h>
 #include <machine/pcb.h>
 
diff -r 2704177e2083 -r 29b142fa00ff sys/arch/evbsh3/include/Makefile
--- a/sys/arch/evbsh3/include/Makefile  Tue Jul 19 15:37:38 2011 +0000
+++ b/sys/arch/evbsh3/include/Makefile  Tue Jul 19 15:44:52 2011 +0000
@@ -1,9 +1,9 @@
-#      $NetBSD: Makefile,v 1.25 2011/07/17 20:54:40 joerg Exp $
+#      $NetBSD: Makefile,v 1.26 2011/07/19 15:44:52 dyoung Exp $
 
 INCSDIR= /usr/include/evbsh3
 
 INCS=  ansi.h aout_machdep.h asm.h \
-       bswap.h bus.h \
+       bswap.h \
        cdefs.h coff_machdep.h cpu.h cputypes.h \
        disklabel.h \
        elf_machdep.h endian.h endian_machdep.h \
diff -r 2704177e2083 -r 29b142fa00ff sys/arch/evbsh3/include/bus.h
--- a/sys/arch/evbsh3/include/bus.h     Tue Jul 19 15:37:38 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,708 +0,0 @@
-/*     $NetBSD: bus.h,v 1.2 2010/04/06 15:54:30 nonaka Exp $   */
-
-/*-
- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
- * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Christopher G. Demetriou
- *     for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _EVBSH3_BUS_H_
-#define        _EVBSH3_BUS_H_
-
-#include <sys/types.h>
-
-#ifdef _KERNEL
-/*
- * Turn on BUS_SPACE_DEBUG if the global DEBUG option is enabled.
- */
-#if defined(DEBUG) && !defined(BUS_SPACE_DEBUG)
-#define        BUS_SPACE_DEBUG
-#endif
-
-#ifdef BUS_SPACE_DEBUG
-#include <sys/systm.h> /* for printf() prototype */
-/*
- * Macros for checking the aligned-ness of pointers passed to bus
- * space ops.  Strict alignment is required by the Alpha architecture,
- * and a trap will occur if unaligned access is performed.  These
- * may aid in the debugging of a broken device driver by displaying
- * useful information about the problem.
- */
-#define        __BUS_SPACE_ALIGNED_ADDRESS(p, t)                               \
-       ((((u_long)(p)) & (sizeof(t)-1)) == 0)
-
-#define        __BUS_SPACE_ADDRESS_SANITY(p, t, d)                             \
-({                                                                     \
-       if (__BUS_SPACE_ALIGNED_ADDRESS((p), t) == 0) {                 \
-               printf("%s 0x%lx not aligned to %lu bytes %s:%d\n",     \
-                   d, (u_long)(p), (u_long)sizeof(t), __FILE__, __LINE__);     \
-       }                                                               \
-       (void) 0;                                                       \
-})
-
-#define BUS_SPACE_ALIGNED_POINTER(p, t) __BUS_SPACE_ALIGNED_ADDRESS(p, t)
-#else
-#define        __BUS_SPACE_ADDRESS_SANITY(p, t, d)     (void) 0
-#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
-#endif /* BUS_SPACE_DEBUG */
-#endif /* _KERNEL */
-
-typedef        u_long  bus_addr_t;
-typedef        u_long  bus_size_t;
-
-typedef struct _bus_space *bus_space_tag_t;
-typedef u_long bus_space_handle_t;
-
-struct _bus_space {
-       /* cookie */
-       void            *bs_cookie;
-
-       /* mapping/unmapping */
-       int             (*bs_map)(void *, bus_addr_t, bus_size_t,
-                           int, bus_space_handle_t *);
-       void            (*bs_unmap)(void *, bus_space_handle_t,
-                           bus_size_t);
-       int             (*bs_subregion)(void *, bus_space_handle_t,
-                           bus_size_t, bus_size_t, bus_space_handle_t *);
-
-       /* allocation/deallocation */
-       int             (*bs_alloc)(void *, bus_addr_t, bus_addr_t,
-                           bus_size_t, bus_size_t, bus_size_t, int,
-                           bus_addr_t *, bus_space_handle_t *);
-       void            (*bs_free)(void *, bus_space_handle_t,
-                           bus_size_t);
-
-       /* get kernel virtual address */
-       void *          (*bs_vaddr)(void *, bus_space_handle_t);
-
-       /* read (single) */
-       uint8_t         (*bs_r_1)(void *, bus_space_handle_t,
-                           bus_size_t);
-       uint16_t        (*bs_r_2)(void *, bus_space_handle_t,
-                           bus_size_t);
-       uint32_t        (*bs_r_4)(void *, bus_space_handle_t,
-                           bus_size_t);
-       uint64_t        (*bs_r_8)(void *, bus_space_handle_t,
-                           bus_size_t);
-
-       /* read multiple */
-       void            (*bs_rm_1)(void *, bus_space_handle_t,
-                           bus_size_t, uint8_t *, bus_size_t);
-       void            (*bs_rm_2)(void *, bus_space_handle_t,
-                           bus_size_t, uint16_t *, bus_size_t);
-       void            (*bs_rm_4)(void *, bus_space_handle_t,
-                           bus_size_t, uint32_t *, bus_size_t);
-       void            (*bs_rm_8)(void *, bus_space_handle_t,
-                           bus_size_t, uint64_t *, bus_size_t);
-                                       
-       /* read region */
-       void            (*bs_rr_1)(void *, bus_space_handle_t,
-                           bus_size_t, uint8_t *, bus_size_t);
-       void            (*bs_rr_2)(void *, bus_space_handle_t,
-                           bus_size_t, uint16_t *, bus_size_t);
-       void            (*bs_rr_4)(void *, bus_space_handle_t,
-                           bus_size_t, uint32_t *, bus_size_t);
-       void            (*bs_rr_8)(void *, bus_space_handle_t,
-                           bus_size_t, uint64_t *, bus_size_t);
-
-       /* read stream (single) */



Home | Main Index | Thread Index | Old Index