Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Glue in ACPI -- not really for prime-time...



details:   https://anonhg.NetBSD.org/src/rev/240bb6ece100
branches:  trunk
changeset: 515537:240bb6ece100
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Sep 28 03:56:21 2001 +0000

description:
Glue in ACPI -- not really for prime-time, but useful for developers.

diffstat:

 sys/arch/i386/i386/mainbus.c |  37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diffs (80 lines):

diff -r 0f1865802327 -r 240bb6ece100 sys/arch/i386/i386/mainbus.c
--- a/sys/arch/i386/i386/mainbus.c      Fri Sep 28 02:30:13 2001 +0000
+++ b/sys/arch/i386/i386/mainbus.c      Fri Sep 28 03:56:21 2001 +0000
@@ -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 <machine/bioscall.h>
@@ -58,6 +59,10 @@
 #include <arch/i386/pnpbios/pnpbiosvar.h>
 #endif
 
+#if NACPI > 0
+#include <dev/acpi/acpivar.h>
+#endif
+
 #if NMCA > 0
 #include <dev/mca/mcavar.h>
 #endif
@@ -85,6 +90,9 @@
 #if NPNPBIOS > 0
        struct pnpbios_attach_args mba_paa;
 #endif
+#if NACPI > 0
+       struct acpibus_attach_args mba_acpi;
+#endif
 };
 
 /*
@@ -132,7 +140,31 @@
 
        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 @@
 #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);



Home | Main Index | Thread Index | Old Index