Index: amd64/acpica/acpi_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/amd64/acpica/acpi_machdep.c,v retrieving revision 1.17 diff -u -r1.17 acpi_machdep.c --- amd64/acpica/acpi_machdep.c 11 Sep 2005 18:39:00 -0000 1.17 +++ amd64/acpica/acpi_machdep.c 7 Mar 2008 20:42:06 -0000 @@ -29,10 +29,14 @@ #include #include +#include +#include #include #include +#include + static int intr_model = ACPI_INTR_PIC; int @@ -67,3 +71,43 @@ { __asm __volatile("sti; hlt"); } + +/* + * ACPI nexus(4) driver. + */ +static int +nexus_acpi_probe(device_t dev) +{ + int error; + + error = acpi_identify(); + if (error) + return (error); + + return (BUS_PROBE_DEFAULT); +} + +static int +nexus_acpi_attach(device_t dev) +{ + + nexus_init_resources(); + bus_generic_probe(dev); + if (BUS_ADD_CHILD(dev, 10, "acpi", 0) == NULL) + panic("failed to add acpi0 device"); + + return (bus_generic_attach(dev)); +} + +static device_method_t nexus_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nexus_acpi_probe), + DEVMETHOD(device_attach, nexus_acpi_attach), + + { 0, 0 } +}; + +DEFINE_CLASS_1(nexus, nexus_acpi_driver, nexus_acpi_methods, 1, nexus_driver); +static devclass_t nexus_devclass; + +DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0); Index: amd64/amd64/legacy.c =================================================================== RCS file: /usr/cvs/src/sys/amd64/amd64/legacy.c,v retrieving revision 1.61 diff -u -r1.61 legacy.c --- amd64/amd64/legacy.c 30 Sep 2007 11:05:13 -0000 1.61 +++ amd64/amd64/legacy.c 7 Mar 2008 20:42:06 -0000 @@ -57,7 +57,6 @@ #define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev)) -static void legacy_identify(driver_t *driver, device_t parent); static int legacy_probe(device_t); static int legacy_attach(device_t); static int legacy_print_child(device_t, device_t); @@ -68,7 +67,6 @@ static device_method_t legacy_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, legacy_identify), DEVMETHOD(device_probe, legacy_probe), DEVMETHOD(device_attach, legacy_attach), DEVMETHOD(device_detach, bus_generic_detach), @@ -100,29 +98,10 @@ DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0); -static void -legacy_identify(driver_t *driver, device_t parent) -{ - - /* - * Add child device with order of 11 so it gets probed - * after ACPI (which is at order 10). - */ - if (BUS_ADD_CHILD(parent, 11, "legacy", 0) == NULL) - panic("legacy: could not attach"); -} - static int legacy_probe(device_t dev) { - device_t acpi; - /* - * Fail to probe if ACPI is ok. - */ - acpi = devclass_get_device(devclass_find("acpi"), 0); - if (acpi != NULL && device_is_alive(acpi)) - return (ENXIO); device_set_desc(dev, "legacy system"); device_quiet(dev); return (0); Index: amd64/amd64/nexus.c =================================================================== RCS file: /usr/cvs/src/sys/amd64/amd64/nexus.c,v retrieving revision 1.78 diff -u -r1.78 nexus.c --- amd64/amd64/nexus.c 28 Oct 2007 21:23:48 -0000 1.78 +++ amd64/amd64/nexus.c 7 Mar 2008 20:42:06 -0000 @@ -61,6 +61,7 @@ #include #include +#include #include #include @@ -73,13 +74,10 @@ #include static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); -struct nexus_device { - struct resource_list nx_resources; -}; #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) -static struct rman irq_rman, drq_rman, port_rman, mem_rman; +struct rman irq_rman, drq_rman, port_rman, mem_rman; static int nexus_probe(device_t); static int nexus_attach(device_t); @@ -146,11 +144,7 @@ { 0, 0 } }; -static driver_t nexus_driver = { - "nexus", - nexus_methods, - 1, /* no softc */ -}; +DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, 1); static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); @@ -158,9 +152,15 @@ static int nexus_probe(device_t dev) { - int irq; device_quiet(dev); /* suppress attach message for neatness */ + return (BUS_PROBE_GENERIC); +} + +void +nexus_init_resources(void) +{ + int irq; /* * XXX working notes: @@ -185,7 +185,7 @@ irq_rman.rm_descr = "Interrupt request lines"; irq_rman.rm_end = NUM_IO_INTS - 1; if (rman_init(&irq_rman)) - panic("nexus_probe irq_rman"); + panic("nexus_init_resources irq_rman"); /* * We search for regions of existing IRQs and add those to the IRQ @@ -194,7 +194,7 @@ for (irq = 0; irq < NUM_IO_INTS; irq++) if (intr_lookup_source(irq) != NULL) if (rman_manage_region(&irq_rman, irq, irq) != 0) - panic("nexus_probe irq_rman add"); + panic("nexus_init_resources irq_rman add"); /* * ISA DMA on PCI systems is implemented in the ISA part of each @@ -209,7 +209,7 @@ if (rman_init(&drq_rman) || rman_manage_region(&drq_rman, drq_rman.rm_start, drq_rman.rm_end)) - panic("nexus_probe drq_rman"); + panic("nexus_init_resources drq_rman"); /* * However, IO ports and Memory truely are global at this level, @@ -222,7 +222,7 @@ port_rman.rm_descr = "I/O ports"; if (rman_init(&port_rman) || rman_manage_region(&port_rman, 0, 0xffff)) - panic("nexus_probe port_rman"); + panic("nexus_init_resources port_rman"); mem_rman.rm_start = 0; mem_rman.rm_end = ~0u; @@ -230,16 +230,23 @@ mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) - panic("nexus_probe mem_rman"); - - return 0; + panic("nexus_init_resources mem_rman"); } static int nexus_attach(device_t dev) { + nexus_init_resources(); bus_generic_probe(dev); + + /* + * Explicitly add the legacy0 device here. Other platform + * types (such as ACPI), use their own nexus(4) subclass + * driver to override this routine and add their own root bus. + */ + if (BUS_ADD_CHILD(dev, 10, "legacy", 0) == NULL) + panic("legacy: could not attach"); bus_generic_attach(dev); return 0; } Index: amd64/include/nexusvar.h =================================================================== RCS file: amd64/include/nexusvar.h diff -N amd64/include/nexusvar.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ amd64/include/nexusvar.h 7 Mar 2008 20:42:26 -0000 @@ -0,0 +1,45 @@ +/*- + * Copyright 1998 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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$ + */ + +#ifndef _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ + +struct nexus_device { + struct resource_list nx_resources; +}; + +DECLARE_CLASS(nexus_driver); + +extern struct rman irq_rman, drq_rman, port_rman, mem_rman; + +void nexus_init_resources(void); + +#endif /* !_MACHINE_NEXUSVAR_H_ */ Index: dev/acpica/acpi.c =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.245 diff -u -r1.245 acpi.c --- dev/acpica/acpi.c 28 Jan 2008 01:57:48 -0000 1.245 +++ dev/acpica/acpi.c 7 Mar 2008 20:42:06 -0000 @@ -91,7 +91,6 @@ int acpi_quirks; static int acpi_modevent(struct module *mod, int event, void *junk); -static void acpi_identify(driver_t *driver, device_t parent); static int acpi_probe(device_t dev); static int acpi_attach(device_t dev); static int acpi_suspend(device_t dev); @@ -156,7 +155,6 @@ static device_method_t acpi_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, acpi_identify), DEVMETHOD(device_probe, acpi_probe), DEVMETHOD(device_attach, acpi_attach), DEVMETHOD(device_shutdown, acpi_shutdown), @@ -219,6 +217,9 @@ static const char* sleep_state_names[] = { "S0", "S1", "S2", "S3", "S4", "S5", "NONE"}; +/* Holds the description of the acpi0 device. */ +static char acpi_desc[ACPI_OEM_ID_SIZE + ACPI_OEM_TABLE_ID_SIZE + 2]; + SYSCTL_NODE(_debug, OID_AUTO, acpi, CTLFLAG_RD, NULL, "ACPI debugging"); static char acpi_ca_version[12]; SYSCTL_STRING(_debug_acpi, OID_AUTO, acpi_ca_version, CTLFLAG_RD, @@ -316,64 +317,41 @@ } /* - * Detect ACPI, perform early initialisation + * Detect ACPI and perform early initialisation. */ -static void -acpi_identify(driver_t *driver, device_t parent) +int +acpi_identify(void) { - device_t child; + ACPI_TABLE_RSDP *rsdp; + ACPI_TABLE_HEADER *rsdt; + ACPI_PHYSICAL_ADDRESS paddr; + struct sbuf sb; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (!cold) - return_VOID; + return (ENXIO); /* Check that we haven't been disabled with a hint. */ if (resource_disabled("acpi", 0)) - return_VOID; - - /* Make sure we're not being doubly invoked. */ - if (device_find_child(parent, "acpi", 0) != NULL) - return_VOID; + return (ENXIO); - snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%x", ACPI_CA_VERSION); + /* Check for other PM systems. */ + if (power_pm_get_type() != POWER_PM_TYPE_NONE && + power_pm_get_type() != POWER_PM_TYPE_ACPI) { + printf("ACPI identify failed, other PM system enabled.\n"); + return (ENXIO); + } /* Initialize root tables. */ if (ACPI_FAILURE(acpi_Startup())) { printf("ACPI: Try disabling either ACPI or apic support.\n"); - return_VOID; - } - - /* Attach the actual ACPI device. */ - if ((child = BUS_ADD_CHILD(parent, 10, "acpi", 0)) == NULL) { - device_printf(parent, "device_identify failed\n"); - return_VOID; - } -} - -/* - * Fetch some descriptive data from ACPI to put in our attach message. - */ -static int -acpi_probe(device_t dev) -{ - ACPI_TABLE_RSDP *rsdp; - ACPI_TABLE_HEADER *rsdt; - ACPI_PHYSICAL_ADDRESS paddr; - char buf[ACPI_OEM_ID_SIZE + ACPI_OEM_TABLE_ID_SIZE + 2]; - struct sbuf sb; - - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - - if (power_pm_get_type() != POWER_PM_TYPE_NONE && - power_pm_get_type() != POWER_PM_TYPE_ACPI) { - device_printf(dev, "probe failed, other PM system enabled.\n"); - return_VALUE (ENXIO); + return (ENXIO); } if ((paddr = AcpiOsGetRootPointer()) == 0 || (rsdp = AcpiOsMapMemory(paddr, sizeof(ACPI_TABLE_RSDP))) == NULL) - return_VALUE (ENXIO); + return (ENXIO); if (rsdp->Revision > 1 && rsdp->XsdtPhysicalAddress != 0) paddr = (ACPI_PHYSICAL_ADDRESS)rsdp->XsdtPhysicalAddress; else @@ -381,18 +359,33 @@ AcpiOsUnmapMemory(rsdp, sizeof(ACPI_TABLE_RSDP)); if ((rsdt = AcpiOsMapMemory(paddr, sizeof(ACPI_TABLE_HEADER))) == NULL) - return_VALUE (ENXIO); - sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + return (ENXIO); + sbuf_new(&sb, acpi_desc, sizeof(acpi_desc), SBUF_FIXEDLEN); sbuf_bcat(&sb, rsdt->OemId, ACPI_OEM_ID_SIZE); sbuf_trim(&sb); sbuf_putc(&sb, ' '); sbuf_bcat(&sb, rsdt->OemTableId, ACPI_OEM_TABLE_ID_SIZE); sbuf_trim(&sb); sbuf_finish(&sb); - device_set_desc_copy(dev, sbuf_data(&sb)); sbuf_delete(&sb); AcpiOsUnmapMemory(rsdt, sizeof(ACPI_TABLE_HEADER)); + snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%x", ACPI_CA_VERSION); + + return (0); +} + +/* + * Fetch some descriptive data from ACPI to put in our attach message. + */ +static int +acpi_probe(device_t dev) +{ + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + device_set_desc(dev, acpi_desc); + return_VALUE (0); } Index: dev/acpica/acpivar.h =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.108 diff -u -r1.108 acpivar.h --- dev/acpica/acpivar.h 9 Oct 2007 07:48:07 -0000 1.108 +++ dev/acpica/acpivar.h 7 Mar 2008 20:42:06 -0000 @@ -364,6 +364,7 @@ extern struct acpi_parse_resource_set acpi_res_parse_set; +int acpi_identify(void); void acpi_config_intr(device_t dev, ACPI_RESOURCE *res); ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, ACPI_RESOURCE *acpi_res); Index: i386/acpica/acpi_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/acpica/acpi_machdep.c,v retrieving revision 1.37 diff -u -r1.37 acpi_machdep.c --- i386/acpica/acpi_machdep.c 7 Jul 2007 17:54:33 -0000 1.37 +++ i386/acpica/acpi_machdep.c 7 Mar 2008 20:42:07 -0000 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,8 @@ #include #include +#include + /* * APM driver emulation */ @@ -549,3 +552,43 @@ { __asm __volatile("sti; hlt"); } + +/* + * ACPI nexus(4) driver. + */ +static int +nexus_acpi_probe(device_t dev) +{ + int error; + + error = acpi_identify(); + if (error) + return (error); + + return (BUS_PROBE_DEFAULT); +} + +static int +nexus_acpi_attach(device_t dev) +{ + + nexus_init_resources(); + bus_generic_probe(dev); + if (BUS_ADD_CHILD(dev, 10, "acpi", 0) == NULL) + panic("failed to add acpi0 device"); + + return (bus_generic_attach(dev)); +} + +static device_method_t nexus_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nexus_acpi_probe), + DEVMETHOD(device_attach, nexus_acpi_attach), + + { 0, 0 } +}; + +DEFINE_CLASS_1(nexus, nexus_acpi_driver, nexus_acpi_methods, 1, nexus_driver); +static devclass_t nexus_devclass; + +DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0); Index: i386/i386/legacy.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/legacy.c,v retrieving revision 1.63 diff -u -r1.63 legacy.c --- i386/i386/legacy.c 30 Sep 2007 11:05:16 -0000 1.63 +++ i386/i386/legacy.c 7 Mar 2008 20:42:07 -0000 @@ -62,7 +62,6 @@ #define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev)) -static void legacy_identify(driver_t *driver, device_t parent); static int legacy_probe(device_t); static int legacy_attach(device_t); static int legacy_print_child(device_t, device_t); @@ -73,7 +72,6 @@ static device_method_t legacy_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, legacy_identify), DEVMETHOD(device_probe, legacy_probe), DEVMETHOD(device_attach, legacy_attach), DEVMETHOD(device_detach, bus_generic_detach), @@ -105,29 +103,10 @@ DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0); -static void -legacy_identify(driver_t *driver, device_t parent) -{ - - /* - * Add child device with order of 11 so it gets probed - * after ACPI (which is at order 10). - */ - if (BUS_ADD_CHILD(parent, 11, "legacy", 0) == NULL) - panic("legacy: could not attach"); -} - static int legacy_probe(device_t dev) { - device_t acpi; - /* - * Fail to probe if ACPI is ok. - */ - acpi = devclass_get_device(devclass_find("acpi"), 0); - if (acpi != NULL && device_is_alive(acpi)) - return (ENXIO); device_set_desc(dev, "legacy system"); device_quiet(dev); return (0); Index: i386/i386/nexus.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/nexus.c,v retrieving revision 1.73 diff -u -r1.73 nexus.c --- i386/i386/nexus.c 8 May 2007 21:29:14 -0000 1.73 +++ i386/i386/nexus.c 7 Mar 2008 20:42:07 -0000 @@ -60,6 +60,7 @@ #include #include +#include #include #ifdef DEV_APIC @@ -77,13 +78,10 @@ #include static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); -struct nexus_device { - struct resource_list nx_resources; -}; #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) -static struct rman irq_rman, drq_rman, port_rman, mem_rman; +struct rman irq_rman, drq_rman, port_rman, mem_rman; static int nexus_probe(device_t); static int nexus_attach(device_t); @@ -154,11 +152,7 @@ { 0, 0 } }; -static driver_t nexus_driver = { - "nexus", - nexus_methods, - 1, /* no softc */ -}; +DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, 1); static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); @@ -166,9 +160,15 @@ static int nexus_probe(device_t dev) { - int irq; device_quiet(dev); /* suppress attach message for neatness */ + return (BUS_PROBE_GENERIC); +} + +void +nexus_init_resources(void) +{ + int irq; /* * XXX working notes: @@ -193,7 +193,7 @@ irq_rman.rm_descr = "Interrupt request lines"; irq_rman.rm_end = NUM_IO_INTS - 1; if (rman_init(&irq_rman)) - panic("nexus_probe irq_rman"); + panic("nexus_init_resources irq_rman"); /* * We search for regions of existing IRQs and add those to the IRQ @@ -202,7 +202,7 @@ for (irq = 0; irq < NUM_IO_INTS; irq++) if (intr_lookup_source(irq) != NULL) if (rman_manage_region(&irq_rman, irq, irq) != 0) - panic("nexus_probe irq_rman add"); + panic("nexus_init_resources irq_rman add"); /* * ISA DMA on PCI systems is implemented in the ISA part of each @@ -221,7 +221,7 @@ if (rman_init(&drq_rman) || rman_manage_region(&drq_rman, drq_rman.rm_start, drq_rman.rm_end)) - panic("nexus_probe drq_rman"); + panic("nexus_init_resources drq_rman"); /* * However, IO ports and Memory truely are global at this level, @@ -234,7 +234,7 @@ port_rman.rm_descr = "I/O ports"; if (rman_init(&port_rman) || rman_manage_region(&port_rman, 0, 0xffff)) - panic("nexus_probe port_rman"); + panic("nexus_init_resources port_rman"); mem_rman.rm_start = 0; mem_rman.rm_end = ~0u; @@ -242,16 +242,23 @@ mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) - panic("nexus_probe mem_rman"); - - return 0; + panic("nexus_init_resources mem_rman"); } static int nexus_attach(device_t dev) { + nexus_init_resources(); bus_generic_probe(dev); + + /* + * Explicitly add the legacy0 device here. Other platform + * types (such as ACPI), use their own nexus(4) subclass + * driver to override this routine and add their own root bus. + */ + if (BUS_ADD_CHILD(dev, 10, "legacy", 0) == NULL) + panic("legacy: could not attach"); bus_generic_attach(dev); return 0; } Index: i386/include/nexusvar.h =================================================================== RCS file: i386/include/nexusvar.h diff -N i386/include/nexusvar.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ i386/include/nexusvar.h 7 Mar 2008 20:42:16 -0000 @@ -0,0 +1,45 @@ +/*- + * Copyright 1998 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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$ + */ + +#ifndef _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ + +struct nexus_device { + struct resource_list nx_resources; +}; + +DECLARE_CLASS(nexus_driver); + +extern struct rman irq_rman, drq_rman, port_rman, mem_rman; + +void nexus_init_resources(void); + +#endif /* !_MACHINE_NEXUSVAR_H_ */ Index: ia64/ia64/nexus.c =================================================================== RCS file: /usr/cvs/src/sys/ia64/ia64/nexus.c,v retrieving revision 1.18 diff -u -r1.18 nexus.c --- ia64/ia64/nexus.c 30 Jul 2007 22:29:32 -0000 1.18 +++ ia64/ia64/nexus.c 7 Mar 2008 20:42:07 -0000 @@ -60,6 +60,9 @@ #include #include +#include +#include + #include #include @@ -217,12 +220,15 @@ static int nexus_attach(device_t dev) { + /* * Mask the legacy PICs - we will use the I/O SAPIC for interrupt. */ outb(IO_ICU1+1, 0xff); outb(IO_ICU2+1, 0xff); + if (acpi_identify() == 0) + BUS_ADD_CHILD(dev, 10, "acpi", 0); bus_generic_attach(dev); return 0; }