Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Enable new-style <sys/bus.h> on several PowerPC por...



details:   https://anonhg.NetBSD.org/src/rev/db581bcc0491
branches:  trunk
changeset: 767388:db581bcc0491
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Sun Jul 17 23:23:53 2011 +0000

description:
Enable new-style <sys/bus.h> on several PowerPC ports supporting PCI
buses.  Make non-inline implementations of bus_space(9) and bus_dma(9)
routines and move them to appropriate .c files.

This may leave amigappc in a bad state, sorry.  Fortunately, it will be
easy to repair by imitating the bus.h -> bus_{defs,funcs}.h split in
some other PowerPC port.

diffstat:

 sys/arch/evbppc/include/bus.h         |    3 -
 sys/arch/evbppc/include/types.h       |    4 +-
 sys/arch/macppc/include/bus.h         |    7 -
 sys/arch/macppc/include/types.h       |    4 +-
 sys/arch/mvmeppc/include/bus.h        |   38 -
 sys/arch/mvmeppc/include/types.h      |    4 +-
 sys/arch/ofppc/include/bus.h          |    7 -
 sys/arch/ofppc/include/types.h        |    4 +-
 sys/arch/powerpc/include/bus.h        |  827 ----------------------------------
 sys/arch/powerpc/include/types.h      |    3 +-
 sys/arch/powerpc/oea/ofwoea_machdep.c |    7 +-
 sys/arch/powerpc/powerpc/bus_dma.c    |    8 +-
 12 files changed, 17 insertions(+), 899 deletions(-)

diffs (truncated from 1027 to 300 lines):

diff -r 2a75719424f1 -r db581bcc0491 sys/arch/evbppc/include/bus.h
--- a/sys/arch/evbppc/include/bus.h     Sun Jul 17 23:18:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: bus.h,v 1.6 2005/12/11 12:17:12 christos Exp $ */
-
-#include <powerpc/bus.h>
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/evbppc/include/types.h
--- a/sys/arch/evbppc/include/types.h   Sun Jul 17 23:18:23 2011 +0000
+++ b/sys/arch/evbppc/include/types.h   Sun Jul 17 23:23:53 2011 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: types.h,v 1.9 2008/01/20 18:09:06 joerg Exp $  */
+/*     $NetBSD: types.h,v 1.10 2011/07/17 23:23:53 dyoung Exp $        */
 
 #include <powerpc/types.h>
 
-#define        __HAVE_DEVICE_REGISTER
+#define        __HAVE_NEW_STYLE_BUS_H
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/macppc/include/bus.h
--- a/sys/arch/macppc/include/bus.h     Sun Jul 17 23:18:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-/*     $NetBSD: bus.h,v 1.26 2007/12/25 17:55:10 macallan Exp $        */
-
-#define PHYS_TO_BUS_MEM(t,x)   (x)
-#define BUS_MEM_TO_PHYS(t,x)   (x)
-
-#include <powerpc/bus.h>
-#include <powerpc/ofw_bus.h>
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/macppc/include/types.h
--- a/sys/arch/macppc/include/types.h   Sun Jul 17 23:18:23 2011 +0000
+++ b/sys/arch/macppc/include/types.h   Sun Jul 17 23:23:53 2011 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: types.h,v 1.13 2008/01/20 18:09:07 joerg Exp $ */
+/*     $NetBSD: types.h,v 1.14 2011/07/17 23:23:53 dyoung Exp $        */
 
 #include <powerpc/types.h>
 
-#define        __HAVE_DEVICE_REGISTER
+#define        __HAVE_NEW_STYLE_BUS_H
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/mvmeppc/include/bus.h
--- a/sys/arch/mvmeppc/include/bus.h    Sun Jul 17 23:18:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*     $NetBSD: bus.h,v 1.6 2008/05/03 23:59:09 martin Exp $   */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Steve C. Woodford.
- *
- * 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.
- */
-
-#ifndef _MVMEPPC_BUS_H_
-#define _MVMEPPC_BUS_H_
-
-#include <powerpc/prep_bus.h>
-#include <powerpc/bus.h>
-
-#endif /* _MVMEPPC_BUS_H_ */
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/mvmeppc/include/types.h
--- a/sys/arch/mvmeppc/include/types.h  Sun Jul 17 23:18:23 2011 +0000
+++ b/sys/arch/mvmeppc/include/types.h  Sun Jul 17 23:23:53 2011 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: types.h,v 1.7 2010/07/17 15:25:57 tsutsui Exp $        */
+/*     $NetBSD: types.h,v 1.8 2011/07/17 23:23:53 dyoung Exp $ */
 
 #include <powerpc/types.h>
 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/ofppc/include/bus.h
--- a/sys/arch/ofppc/include/bus.h      Sun Jul 17 23:18:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-/*     $NetBSD: bus.h,v 1.12 2007/11/04 17:15:43 garbled Exp $ */
-
-#define PHYS_TO_BUS_MEM(t,x)   (x)
-#define BUS_MEM_TO_PHYS(t,x)   (x)
-
-#include <powerpc/ofw_bus.h>
-#include <powerpc/bus.h>
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/ofppc/include/types.h
--- a/sys/arch/ofppc/include/types.h    Sun Jul 17 23:18:23 2011 +0000
+++ b/sys/arch/ofppc/include/types.h    Sun Jul 17 23:23:53 2011 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: types.h,v 1.10 2008/01/20 18:09:08 joerg Exp $ */
+/*     $NetBSD: types.h,v 1.11 2011/07/17 23:23:53 dyoung Exp $        */
 
-#define        __HAVE_DEVICE_REGISTER
+#define        __HAVE_NEW_STYLE_BUS_H
 
 #include <powerpc/types.h>
diff -r 2a75719424f1 -r db581bcc0491 sys/arch/powerpc/include/bus.h
--- a/sys/arch/powerpc/include/bus.h    Sun Jul 17 23:18:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,827 +0,0 @@
-/*     $NetBSD: bus.h,v 1.21 2011/06/09 19:09:57 matt Exp $    */
-/*     $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $    */
-
-/*-
- * Copyright (c) 1996, 1997, 1998 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 Jason R. Thorpe.  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.
- */
-
-/*
- * Copyright (c) 1997 Per Fogelstrom.  All rights reserved.
- * Copyright (c) 1996 Niklas Hallqvist.  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 _POWERPC_BUS_H_
-#define _POWERPC_BUS_H_
-
-#if defined(_KERNEL_OPT) && !defined(BUS_DMA_COHERENT)
-#include "opt_ppcarch.h"
-#if defined(PPC_IBM4XX) || defined(PPC_BOOKE)
-#define BUS_DMA_COHERENT BUS_DMA_NOCACHE
-#endif /* PPC_IBM4XX */
-#endif /* _KERNEL_OPT && !BUS_DMA_COHERENT */
-
-
-/*
- * Bus access types.
- */
-typedef uint32_t bus_addr_t;
-typedef uint32_t bus_size_t;
-
-#ifndef __HAVE_LOCAL_BUS_SPACE
-typedef        uint32_t bus_space_handle_t;
-typedef        const struct powerpc_bus_space *bus_space_tag_t;
-
-struct extent;
-
-struct powerpc_bus_space_scalar {
-       uint8_t (*pbss_read_1)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t);
-       uint16_t (*pbss_read_2)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t);
-       uint32_t (*pbss_read_4)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t);
-       uint64_t (*pbss_read_8)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t);
-
-       void (*pbss_write_1)(bus_space_tag_t, bus_space_handle_t, bus_size_t,
-           uint8_t);
-       void (*pbss_write_2)(bus_space_tag_t, bus_space_handle_t, bus_size_t,
-           uint16_t);
-       void (*pbss_write_4)(bus_space_tag_t, bus_space_handle_t, bus_size_t,
-           uint32_t);
-       void (*pbss_write_8)(bus_space_tag_t, bus_space_handle_t, bus_size_t,
-           uint64_t);
-};
-
-struct powerpc_bus_space_group {
-       void (*pbsg_read_1)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint8_t *, size_t);
-       void (*pbsg_read_2)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint16_t *, size_t);
-       void (*pbsg_read_4)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint32_t *, size_t);
-       void (*pbsg_read_8)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint64_t *, size_t);
-
-       void (*pbsg_write_1)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, const uint8_t *, size_t);
-       void (*pbsg_write_2)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, const uint16_t *, size_t);
-       void (*pbsg_write_4)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, const uint32_t *, size_t);
-       void (*pbsg_write_8)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, const uint64_t *, size_t);
-};
-
-struct powerpc_bus_space_set {
-       void (*pbss_set_1)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint8_t, size_t);
-       void (*pbss_set_2)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint16_t, size_t);
-       void (*pbss_set_4)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint32_t, size_t);
-       void (*pbss_set_8)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, uint64_t, size_t);
-};
-
-struct powerpc_bus_space_copy {
-       void (*pbsc_copy_1)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, bus_space_handle_t, bus_size_t, size_t);
-       void (*pbsc_copy_2)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, bus_space_handle_t, bus_size_t, size_t);
-       void (*pbsc_copy_4)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, bus_space_handle_t, bus_size_t, size_t);
-       void (*pbsc_copy_8)(bus_space_tag_t, bus_space_handle_t,
-           bus_size_t, bus_space_handle_t, bus_size_t, size_t);
-};
-



Home | Main Index | Thread Index | Old Index