From owner-p4-projects@FreeBSD.ORG Mon Nov 3 16:45:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 367CC16A4D0; Mon, 3 Nov 2003 16:45:23 -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 EF84516A4CE for ; Mon, 3 Nov 2003 16:45:22 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4919143FB1 for ; Mon, 3 Nov 2003 16:45:22 -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 hA40jMXJ036188 for ; Mon, 3 Nov 2003 16:45:22 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hA40jLAO036185 for perforce@freebsd.org; Mon, 3 Nov 2003 16:45:21 -0800 (PST) (envelope-from peter@freebsd.org) Date: Mon, 3 Nov 2003 16:45:21 -0800 (PST) Message-Id: <200311040045.hA40jLAO036185@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 41290 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: Tue, 04 Nov 2003 00:45:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=41290 Change 41290 by peter@peter_daintree on 2003/11/03 16:45:10 integrate -I smp_hammer @41229 (jhb's sync prior to commits) Affected files ... .. //depot/projects/hammer/sys/amd64/acpica/madt.c#10 integrate .. //depot/projects/hammer/sys/amd64/amd64/io_apic.c#11 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#14 integrate .. //depot/projects/hammer/sys/amd64/amd64/mptable.c#6 integrate .. //depot/projects/hammer/sys/amd64/amd64/mptable_pci.c#2 integrate .. //depot/projects/hammer/sys/amd64/isa/atpic.c#10 integrate .. //depot/projects/hammer/sys/jhb_notes#8 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/acpica/madt.c#10 (text+ko) ==== @@ -10,6 +10,9 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -22,10 +25,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -643,7 +647,7 @@ break; } } - if (pc->pc_acpi_id == -1) + if (j == NLAPICS + 1) panic("Unable to find ACPI ID for CPU %d", i); } } ==== //depot/projects/hammer/sys/amd64/amd64/io_apic.c#11 (text+ko) ==== @@ -25,10 +25,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_isa.h" #include "opt_no_mixed_mode.h" ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#14 (text+ko) ==== @@ -10,6 +10,9 @@ * notice, this list of conditions and the following disclaimer. * 2. The name of the developer may NOT be used to endorse or promote products * derived from this software without specific prior written permission. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -22,14 +25,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/i386/mpapic.c,v 1.60 2002/09/21 19:03:42 markm Exp $ */ /* * Local APIC support on Pentium and later processors. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include ==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#6 (text+ko) ==== @@ -22,10 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.208 2003/05/15 05:12:24 alc Exp $ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include ==== //depot/projects/hammer/sys/amd64/amd64/mptable_pci.c#2 (text+ko) ==== @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ /* ==== //depot/projects/hammer/sys/amd64/isa/atpic.c#10 (text+ko) ==== @@ -25,14 +25,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ /* * PIC driver for the 8259A Master and Slave PICs in PC/AT machines. */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -45,9 +46,10 @@ #include #include +#include #include -#include #include +#include #include #include @@ -303,6 +305,70 @@ #ifdef DEV_ISA /* + * Bus attachment for the ISA PIC. + */ +static struct isa_pnp_id atpic_ids[] = { + { 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, + { 0 } +}; + +static int +atpic_probe(device_t dev) +{ + int result; + + result = ISA_PNP_PROBE(device_get_parent(dev), dev, atpic_ids); + if (result <= 0) + device_quiet(dev); + return (result); +} + +/* + * We might be granted IRQ 2, as this is typically consumed by chaining + * between the two PIC components. If we're using the APIC, however, + * this may not be the case, and as such we should free the resource. + * (XXX untested) + * + * The generic ISA attachment code will handle allocating any other resources + * that we don't explicitly claim here. + */ +static int +atpic_attach(device_t dev) +{ + struct resource *res; + int rid; + + /* Try to allocate our IRQ and then free it. */ + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, 0); + if (res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, rid, res); + return (0); +} + +static device_method_t atpic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, atpic_probe), + DEVMETHOD(device_attach, atpic_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + { 0, 0 } +}; + +static driver_t atpic_driver = { + "atpic", + atpic_methods, + 1, /* no softc */ +}; + +static devclass_t atpic_devclass; + +DRIVER_MODULE(atpic, isa, atpic_driver, atpic_devclass, 0, 0); +DRIVER_MODULE(atpic, acpi, atpic_driver, atpic_devclass, 0, 0); + +/* * Return a bitmap of the current interrupt requests. This is 8259-specific * and is only suitable for use at probe time. */ @@ -316,5 +382,4 @@ irr2 = inb(IO_ICU2); return ((irr2 << 8) | irr1); } -#endif - +#endif /* DEV_ISA */ ==== //depot/projects/hammer/sys/jhb_notes#8 (text+ko) ==== @@ -9,6 +9,7 @@ - isa/intr_machdep.h -> include/intr_machdep.h (sort of) New files: +- acpica/madt.c - i386/local_apic.c - i386/io_apic.c - i386/mptable.c (from mp_machdep.c) @@ -28,6 +29,15 @@ - isa/ithread.c - isa/vector.s +Repocopies needed: +- include/apic.h -> include/apicreg.h +- isa/apic_vector.s -> i386/apic_vector.s +- isa/icu_vector.s -> isa/atpic_vector.s +- isa/intr_machdep.c -> isa/atpic.c (nothing will be kept) +- isa/intr_machdep.c -> isa/nmi.c +- i386/mp_machdep.c -> include/mptable.h +- i386/mp_machdep.c -> i386/mptable.c + Todo: - DDB + Add APIC ID to show pcpu