summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-09-01 05:48:19 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-09-01 05:48:19 +0000
commit62aed17c49c1b0d9f5091657be7fa35f73271aac (patch)
tree11b122a2bba14fc6ebc9a3853fc97f45ff88eee4 /sys
parented5522d388450d42aa317704788475fc68467277 (diff)
Add __HAVE_DEVICE_REGISTER to hp300/alpha (sparc64 already had it) and
clean up the arch specific #ifdef's in subr_autoconf.c; from NetBSD. (tested by me on alpha/sparc64 and miod on hp300)
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/include/autoconf.h4
-rw-r--r--sys/arch/alpha/include/types.h6
-rw-r--r--sys/arch/hp300/include/autoconf.h5
-rw-r--r--sys/arch/hp300/include/types.h4
-rw-r--r--sys/kern/subr_autoconf.c9
-rw-r--r--sys/sys/device.h6
6 files changed, 15 insertions, 19 deletions
diff --git a/sys/arch/alpha/include/autoconf.h b/sys/arch/alpha/include/autoconf.h
index 24c14880716..5bfbd0f5f95 100644
--- a/sys/arch/alpha/include/autoconf.h
+++ b/sys/arch/alpha/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.11 2001/05/05 22:33:26 art Exp $ */
+/* $OpenBSD: autoconf.h,v 1.12 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: autoconf.h,v 1.19 2000/06/08 03:10:06 thorpej Exp $ */
/*
@@ -117,6 +117,4 @@ extern struct bootinfo_kernel bootinfo;
const char *alpha_variation_name(u_int64_t,
const struct alpha_variation_table *);
const char *alpha_unknown_sysname(void);
-
-void device_register __P((struct device *, void *));
#endif /* _KERNEL */
diff --git a/sys/arch/alpha/include/types.h b/sys/arch/alpha/include/types.h
index 22cfa2322ed..ec20d662056 100644
--- a/sys/arch/alpha/include/types.h
+++ b/sys/arch/alpha/include/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.10 2001/08/11 01:58:34 art Exp $ */
+/* $OpenBSD: types.h,v 1.11 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: types.h,v 1.6 1996/12/05 00:13:47 cgd Exp $ */
/*-
@@ -76,7 +76,7 @@ typedef unsigned long long uint64_t;
typedef long register_t;
#define __BROKEN_INDIRECT_CONFIG
-
-#define __HAVE_NWSCONS
+#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NWSCONS
#endif /* _MACHTYPES_H_ */
diff --git a/sys/arch/hp300/include/autoconf.h b/sys/arch/hp300/include/autoconf.h
index 1b2daccb169..038c42d50f0 100644
--- a/sys/arch/hp300/include/autoconf.h
+++ b/sys/arch/hp300/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.5 2001/05/05 22:33:37 art Exp $ */
+/* $OpenBSD: autoconf.h,v 1.6 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: autoconf.h,v 1.4 1997/04/01 03:03:56 scottr Exp $ */
/*-
@@ -48,7 +48,4 @@ void hp300_cninit __P((void));
void console_scan __P((int (*)(int, caddr_t, void *), void *));
caddr_t iomap __P((caddr_t, int));
void iounmap __P((caddr_t, int));
-
-struct device;
-void device_register __P((struct device *, void *));
#endif /* _KERNEL */
diff --git a/sys/arch/hp300/include/types.h b/sys/arch/hp300/include/types.h
index 17526a9e308..3cab2a988d6 100644
--- a/sys/arch/hp300/include/types.h
+++ b/sys/arch/hp300/include/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.2 1997/01/12 15:13:45 downsj Exp $ */
+/* $OpenBSD: types.h,v 1.3 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: types.h,v 1.8 1996/12/17 08:11:50 thorpej Exp $ */
#ifndef _MACHINE_TYPES_H_
@@ -6,4 +6,6 @@
#include <m68k/types.h>
+#define __HAVE_DEVICE_REGISTER
+
#endif
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 3a98853b7e1..6fff40bba87 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.28 2001/08/31 15:12:05 jason Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.29 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -55,11 +55,6 @@
/* Extra stuff from Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de> */
#include <sys/queue.h>
-/* Bleh! Need device_register proto */
-#if defined(__alpha__) || defined(hp300) || defined(__sparc64__)
-#include <machine/autoconf.h>
-#endif /* __alpha__ || hp300 || __sparc64__ */
-
/*
* Autoconfiguration subroutines.
*/
@@ -425,7 +420,7 @@ config_attach(parent, match, aux, print)
cf->cf_unit++;
}
}
-#if defined(__alpha__) || defined(hp300) || defined(__sparc64__)
+#ifdef __HAVE_DEVICE_REGISTER
device_register(dev, aux);
#endif
(*ca->ca_attach)(parent, dev, aux);
diff --git a/sys/sys/device.h b/sys/sys/device.h
index 24ccaba4416..9a8da896c71 100644
--- a/sys/sys/device.h
+++ b/sys/sys/device.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: device.h,v 1.19 2001/06/22 14:10:59 deraadt Exp $ */
+/* $OpenBSD: device.h,v 1.20 2001/09/01 05:48:18 jason Exp $ */
/* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */
/*
@@ -214,6 +214,10 @@ struct device *device_lookup __P((struct cfdriver *, int unit));
void device_ref __P((struct device *));
void device_unref __P((struct device *));
+#ifdef __HAVE_DEVICE_REGISTER
+void device_register(struct device *, void *);
+#endif
+
/* compatibility definitions */
#define config_found(d, a, p) config_found_sm((d), (a), (p), NULL)
#if 0