summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2005-03-18 09:45:43 +0000
committeriedowse <iedowse@FreeBSD.org>2005-03-18 09:45:43 +0000
commit3c4f225bf8a19c84dde478919f389cf51decf6c7 (patch)
tree89e9ef0915979b6d89817118c4fe34664a6eedbc
parentbc0aad54aafacec07a423a3f84febc0f32355b79 (diff)
downloadFreeBSD-src-3c4f225bf8a19c84dde478919f389cf51decf6c7.zip
FreeBSD-src-3c4f225bf8a19c84dde478919f389cf51decf6c7.tar.gz
Split configure() into 3 separate steps like we do on other
architectures. This makes it possible to insert hooks before and after the device attachment step. Tested thanks to: marcel
-rw-r--r--sys/alpha/alpha/autoconf.c31
-rw-r--r--sys/ia64/ia64/autoconf.c19
2 files changed, 34 insertions, 16 deletions
diff --git a/sys/alpha/alpha/autoconf.c b/sys/alpha/alpha/autoconf.c
index d467ef7..4e72a31 100644
--- a/sys/alpha/alpha/autoconf.c
+++ b/sys/alpha/alpha/autoconf.c
@@ -54,27 +54,21 @@ __FBSDID("$FreeBSD$");
#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 @@ bootdev_ctrl_dev_type(void)
* 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 @@ configure(void *dummy)
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.
diff --git a/sys/ia64/ia64/autoconf.c b/sys/ia64/ia64/autoconf.c
index 0772acc..f5bb3a0 100644
--- a/sys/ia64/ia64/autoconf.c
+++ b/sys/ia64/ia64/autoconf.c
@@ -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 @@ device_t isa_bus_device = 0;
* 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 @@ configure(void *dummy)
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.
OpenPOWER on IntegriCloud