alpha/ia64/powerpc autoconf patch
Ian Dowse
iedowse at maths.tcd.ie
Thu Mar 17 12:52:42 PST 2005
The patch below makes it possible to insert hooks before and after
boot-time device configuration on alpha, ia64 and powerpc like we
can on other architectures. This is needed to allow boot-time USB
bus exploration to happen at the right time.
Could somebody with access to appropriate hardware check to see if
this change causes any problems?
Thanks,
Ian
Index: alpha/alpha/autoconf.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/autoconf.c,v
retrieving revision 1.60
diff -u -r1.60 autoconf.c
--- alpha/alpha/autoconf.c 28 Jul 2004 21:54:56 -0000 1.60
+++ alpha/alpha/autoconf.c 17 Mar 2005 20:33:30 -0000
@@ -54,27 +54,21 @@
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
+static void configure_first(void *);
static void configure(void *);
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
+static void configure_final(void *);
-static void configure_finish(void);
-static void configure_start(void);
+SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
+/* SI_ORDER_SECOND is hookable */
+SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
+/* SI_ORDER_MIDDLE is hookable */
+SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
#ifdef DEV_ISA
#include <isa/isavar.h>
device_t isa_bus_device = 0;
#endif
-static void
-configure_start()
-{
-}
-
-static void
-configure_finish()
-{
-}
-
#if 0
static int
@@ -164,9 +158,13 @@
* Determine i/o configuration for a machine.
*/
static void
+configure_first(void *dummy)
+{
+}
+
+static void
configure(void *dummy)
{
- configure_start();
device_add_child(root_bus, platform.iobus, 0);
@@ -179,8 +177,11 @@
if (isa_bus_device)
isa_probe_children(isa_bus_device);
#endif
+}
- configure_finish();
+static void
+configure_final(void *dummy)
+{
/*
* Now we're ready to handle (pending) interrupts.
Index: ia64/ia64/autoconf.c
===================================================================
RCS file: /home/ncvs/src/sys/ia64/ia64/autoconf.c,v
retrieving revision 1.20
diff -u -r1.20 autoconf.c
--- ia64/ia64/autoconf.c 28 Jul 2004 21:54:56 -0000 1.20
+++ ia64/ia64/autoconf.c 17 Mar 2005 20:33:30 -0000
@@ -49,8 +49,15 @@
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
+static void configure_first(void *);
static void configure(void *);
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
+static void configure_final(void *);
+
+SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
+/* SI_ORDER_SECOND is hookable */
+SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
+/* SI_ORDER_MIDDLE is hookable */
+SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
#ifdef BOOTP
void bootpc_init(void);
@@ -65,6 +72,11 @@
* Determine i/o configuration for a machine.
*/
static void
+configure_first(void *dummy)
+{
+}
+
+static void
configure(void *dummy)
{
device_add_child(root_bus, "nexus", 0);
@@ -78,6 +90,11 @@
if (isa_bus_device)
isa_probe_children(isa_bus_device);
#endif
+}
+
+static void
+configure_final(void *dummy)
+{
/*
* Now we're ready to handle (pending) interrupts.
Index: powerpc/powerpc/autoconf.c
===================================================================
RCS file: /home/ncvs/src/sys/powerpc/powerpc/autoconf.c,v
retrieving revision 1.12
diff -u -r1.12 autoconf.c
--- powerpc/powerpc/autoconf.c 3 Apr 2003 21:36:33 -0000 1.12
+++ powerpc/powerpc/autoconf.c 17 Mar 2005 20:33:30 -0000
@@ -35,17 +35,34 @@
static device_t nexusdev;
+static void configure_first(void *);
static void configure(void *);
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
+static void configure_final(void *);
+
+SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
+/* SI_ORDER_SECOND is hookable */
+SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
+/* SI_ORDER_MIDDLE is hookable */
+SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
/*
* Determine i/o configuration for a machine.
*/
static void
+configure_first(void *dummy)
+{
+}
+
+static void
configure(void *dummy)
{
nexusdev = device_add_child(root_bus, "nexus", 0);
root_bus_configure();
+}
+
+static void
+configure_final(void *dummy)
+{
/*
* Enable device interrupts
More information about the freebsd-current
mailing list