From owner-svn-src-head@FreeBSD.ORG Mon May 24 01:49:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1BC4106566B; Mon, 24 May 2010 01:49:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B498FC14; Mon, 24 May 2010 01:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O1n0Zn052521; Mon, 24 May 2010 01:49:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O1n094052519; Mon, 24 May 2010 01:49:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005240149.o4O1n094052519@svn.freebsd.org> From: Alexander Motin Date: Mon, 24 May 2010 01:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208479 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 01:49:00 -0000 Author: mav Date: Mon May 24 01:49:00 2010 New Revision: 208479 URL: http://svn.freebsd.org/changeset/base/208479 Log: Restore different APIC init orders for i386 and amd64 unified in r208452. Seems noone of them contents both arch for different reasons. Submitted by: kib@ Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon May 24 01:46:06 2010 (r208478) +++ head/sys/x86/x86/local_apic.c Mon May 24 01:49:00 2010 (r208479) @@ -1195,8 +1195,9 @@ apic_register_enumerator(struct apic_enu } /* - * Probe the APIC enumerators, enumerate CPUs, and initialize the - * local APIC. + * We have to look for CPU's very, very early because certain subsystems + * want to know how many CPU's we have extremely early on in the boot + * process. */ static void apic_init(void *dummy __unused) @@ -1257,13 +1258,34 @@ apic_init(void *dummy __unused) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); +#ifdef __amd64__ +} +SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL); + +/* + * Setup the local APIC. We have to do this prior to starting up the APs + * in the SMP case. + */ +static void +apic_setup_local(void *dummy __unused) +{ + int retval; + + if (best_enum == NULL) + return; +#endif /* Third, initialize the local APIC. */ retval = best_enum->apic_setup_local(); if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); } +#ifdef __amd64__ +SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, + NULL); +#else SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL); +#endif /* * Setup the I/O APICs.