summaryrefslogtreecommitdiff
path: root/sys/arch/sun3/dev/obmem.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-03 16:05:01 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-03 16:05:01 +0000
commitf19f6f3c1fb3e32d0ec3a2cfc1155f5773773fac (patch)
treeebc4f86aa5ec5a8abcda7997297093a14dfb8d0b /sys/arch/sun3/dev/obmem.c
parentcb307111a88f57667598461d6faaf39bff1ef2f8 (diff)
sync with 0430.
Diffstat (limited to 'sys/arch/sun3/dev/obmem.c')
-rw-r--r--sys/arch/sun3/dev/obmem.c61
1 files changed, 35 insertions, 26 deletions
diff --git a/sys/arch/sun3/dev/obmem.c b/sys/arch/sun3/dev/obmem.c
index 6a9f557648a..37cce8348bc 100644
--- a/sys/arch/sun3/dev/obmem.c
+++ b/sys/arch/sun3/dev/obmem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: obmem.c,v 1.6 1994/12/12 18:59:23 gwr Exp $ */
+/* $NetBSD: obmem.c,v 1.8 1996/03/26 15:16:17 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -15,21 +15,20 @@
* 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 Adam Glass.
- * 4. The name of the Author may not be used to endorse or promote products
+ * This product includes software developed by Adam Glass and Gordon Ross.
+ * 4. The name of the authors may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY Adam Glass ``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 Adam Glass 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.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
*/
/*
@@ -44,12 +43,28 @@
#include <machine/autoconf.h>
#include <machine/obmem.h>
+static int obmem_match __P((struct device *, void *, void *));
static void obmem_attach __P((struct device *, struct device *, void *));
-static void obmem_scan __P((struct device *, void *));
-struct cfdriver obmemcd = {
- NULL, "obmem", always_match, obmem_attach, DV_DULL,
- sizeof(struct device), 0 };
+struct cfattach obmem_ca = {
+ sizeof(struct device), obmem_match, obmem_attach
+};
+
+struct cfdriver obmem_cd = {
+ NULL, "obmem", DV_DULL
+};
+
+static int
+obmem_match(parent, vcf, aux)
+ struct device *parent;
+ void *vcf, *aux;
+{
+ struct confargs *ca = aux;
+
+ if (ca->ca_bustype != BUS_OBMEM)
+ return (0);
+ return(1);
+}
static void
obmem_attach(parent, self, args)
@@ -58,13 +73,7 @@ obmem_attach(parent, self, args)
void *args;
{
printf("\n");
- config_scan(obmem_scan, self);
-}
-static void
-obmem_scan(parent, child)
- struct device *parent;
- void *child;
-{
- bus_scan(parent, child, BUS_OBMEM);
+ /* We know ca_bustype == BUS_OBMEM */
+ (void) config_search(bus_scan, self, args);
}