From owner-freebsd-current@FreeBSD.ORG Thu Mar 17 20:52:42 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79E7F16A4CE for ; Thu, 17 Mar 2005 20:52:42 +0000 (GMT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 6963343D41 for ; Thu, 17 Mar 2005 20:52:41 +0000 (GMT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 17 Mar 2005 20:52:39 +0000 (GMT) To: current@freebsd.org Date: Thu, 17 Mar 2005 20:52:39 +0000 From: Ian Dowse Message-ID: <200503172052.aa74150@salmon.maths.tcd.ie> Subject: alpha/ia64/powerpc autoconf patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2005 20:52:42 -0000 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 #include +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 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 #include +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