Date: Mon, 3 Nov 2003 16:45:21 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 41290 for review Message-ID: <200311040045.hA40jLAO036185@repoman.freebsd.org>
index | next in thread | raw e-mail
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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> @@ -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 <sys/cdefs.h> +__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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> ==== //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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> ==== //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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -45,9 +46,10 @@ #include <sys/mutex.h> #include <machine/cpufunc.h> +#include <machine/frame.h> #include <machine/intr_machdep.h> -#include <machine/frame.h> #include <machine/md_var.h> +#include <machine/resource.h> #include <machine/segments.h> #include <amd64/isa/isa.h> @@ -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 pcpuhelp
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311040045.hA40jLAO036185>
