diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c index 130c1f42c7e0..e4a687a9bc31 100644 --- a/sys/arch/i386/i386/mainbus.c +++ b/sys/arch/i386/i386/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.32 2001/04/01 23:14:02 jdolecek Exp $ */ +/* $NetBSD: mainbus.c,v 1.33 2001/09/28 03:56:21 thorpej Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -48,6 +48,7 @@ #include "mca.h" #include "apm.h" #include "pnpbios.h" +#include "acpi.h" #if NAPM > 0 #include @@ -58,6 +59,10 @@ #include #endif +#if NACPI > 0 +#include +#endif + #if NMCA > 0 #include #endif @@ -85,6 +90,9 @@ union mainbus_attach_args { #if NPNPBIOS > 0 struct pnpbios_attach_args mba_paa; #endif +#if NACPI > 0 + struct acpibus_attach_args mba_acpi; +#endif }; /* @@ -132,7 +140,31 @@ mainbus_attach(parent, self, aux) printf("\n"); +#if NACPI > 0 + if (acpi_probe()) { + mba.mba_acpi.aa_busname = "acpi"; + mba.mba_acpi.aa_iot = I386_BUS_SPACE_IO; + mba.mba_acpi.aa_memt = I386_BUS_SPACE_MEM; + mba.mba_acpi.aa_pc = NULL; + mba.mba_acpi.aa_pciflags = + PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; + config_found(self, &mba.mba_acpi, mainbus_print); +#if 0 /* XXXJRT not yet */ + if (acpi_active) { + /* + * ACPI already did all the work for us, there + * is nothing more for us to do. + */ + return; + } +#endif + } +#endif + #if NPNPBIOS > 0 +#if NACPI > 0 + if (acpi_active == 0) +#endif if (pnpbios_probe()) { mba.mba_paa.paa_busname = "pnpbios"; mba.mba_paa.paa_ic = &i386_isa_chipset; @@ -189,6 +221,9 @@ mainbus_attach(parent, self, aux) #endif #if NAPM > 0 +#if NACPI > 0 + if (acpi_active == 0) +#endif if (apm_busprobe()) { mba.mba_aaa.aaa_busname = "apm"; config_found(self, &mba.mba_aaa, mainbus_print);