From owner-p4-projects@FreeBSD.ORG Fri Dec 5 14:23:04 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7FD1F16A4D0; Fri, 5 Dec 2003 14:23:04 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43CC816A4CE for ; Fri, 5 Dec 2003 14:23:04 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B1CF43FDF for ; Fri, 5 Dec 2003 14:23:03 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hB5MN3XJ060981 for ; Fri, 5 Dec 2003 14:23:03 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hB5MN2uC060978 for perforce@freebsd.org; Fri, 5 Dec 2003 14:23:02 -0800 (PST) (envelope-from peter@freebsd.org) Date: Fri, 5 Dec 2003 14:23:02 -0800 (PST) Message-Id: <200312052223.hB5MN2uC060978@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 43467 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2003 22:23:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=43467 Change 43467 by peter@peter_daintree on 2003/12/05 14:22:30 Integ -b i386_hammer -I. This catches up with jhb's changes. One change isn't relevant because there is no way to compile out the apic code on amd64, so we dont need the apic stubs. Affected files ... .. //depot/projects/hammer/sys/amd64/acpica/madt.c#23 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#26 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#74 integrate .. //depot/projects/hammer/sys/amd64/amd64/mptable.c#18 integrate .. //depot/projects/hammer/sys/amd64/conf/GENERIC#27 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/acpica/madt.c#23 (text+ko) ==== @@ -190,7 +190,7 @@ XSDT_DESCRIPTOR *xsdt; int i, count; - if (resource_disabled("acpi", 0) || resource_disabled("apic", 0)) + if (resource_disabled("acpi", 0)) return (ENXIO); /* @@ -351,8 +351,7 @@ apic_register_enumerator(&madt_enumerator); } -SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, - madt_register, NULL) +SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, madt_register, NULL) /* * Call the handler routine for each entry in the MADT table. @@ -644,7 +643,7 @@ if (madt == NULL) return; - for (i = 0; i < MAXCPU; i++) { + for (i = 0; i <= mp_maxid; i++) { if (CPU_ABSENT(i)) continue; pc = pcpu_find(i); ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#26 (text+ko) ==== @@ -542,9 +542,8 @@ } /* - * 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. + * Probe the APIC enumerators, enumerate CPUs, and initialize the + * local APIC. */ static void apic_init(void *dummy __unused) @@ -556,6 +555,10 @@ if (!(cpu_feature & CPUID_APIC)) return; + /* Don't probe if APIC mode is disabled. */ + if (resource_disabled("apic", 0)) + return; + /* First, probe all the enumerators to find the best match. */ best_enum = NULL; best = 0; @@ -583,26 +586,14 @@ if (retval != 0) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); -} -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; + /* 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); } -SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_FIRST, apic_setup_local, NULL) +SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_FIRST, apic_init, NULL) /* * Setup the I/O APICs. ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#74 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#18 (text+ko) ==== @@ -370,8 +370,8 @@ apic_register_enumerator(&mptable_enumerator); } -SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, - mptable_register, NULL) +SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register, + NULL) /* * Call the handler routine for each entry in the MP config table. ==== //depot/projects/hammer/sys/amd64/conf/GENERIC#27 (text+ko) ====