Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Add MI support for attaching drivers to arbitra...



details:   https://anonhg.NetBSD.org/src/rev/3d9961fd0108
branches:  trunk
changeset: 1017141:3d9961fd0108
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Dec 13 20:24:26 2020 +0000

description:
Add MI support for attaching drivers to arbitrary System Description
Tables.

diffstat:

 sys/arch/arm/acpi/acpi_machdep.c |   9 ++-------
 sys/dev/acpi/acpi.c              |  19 ++++++++++++++++---
 2 files changed, 18 insertions(+), 10 deletions(-)

diffs (85 lines):

diff -r bc541fac095e -r 3d9961fd0108 sys/arch/arm/acpi/acpi_machdep.c
--- a/sys/arch/arm/acpi/acpi_machdep.c  Sun Dec 13 20:14:48 2020 +0000
+++ b/sys/arch/arm/acpi/acpi_machdep.c  Sun Dec 13 20:24:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.20 2020/10/24 07:08:22 skrll Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.21 2020/12/13 20:24:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.20 2020/10/24 07:08:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.21 2020/12/13 20:24:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -346,8 +346,6 @@
 void
 acpi_md_callback(struct acpi_softc *sc)
 {
-       ACPI_TABLE_HEADER *hdrp;
-
 #if NPCI > 0
        acpi_md_mcfg_bs_tag = arm_generic_bs_tag;
        acpi_md_mcfg_bs_tag.bs_map = acpi_md_mcfg_bs_map;
@@ -364,9 +362,6 @@
                panic("Failed to map GTDT");
        acpi_gtdt_walk(acpi_md_gtdt_probe, sc);
        acpi_gtdt_unmap();
-
-       if (ACPI_SUCCESS(AcpiGetTable(ACPI_SIG_GTDT, 0, &hdrp)))
-               config_found_ia(sc->sc_dev, "acpisdtbus", hdrp, NULL);
 }
 
 static const char * const module_hid[] = {
diff -r bc541fac095e -r 3d9961fd0108 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Sun Dec 13 20:14:48 2020 +0000
+++ b/sys/dev/acpi/acpi.c       Sun Dec 13 20:24:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.287 2020/12/07 10:57:41 jmcneill Exp $      */
+/*     $NetBSD: acpi.c,v 1.288 2020/12/13 20:24:26 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.287 2020/12/07 10:57:41 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.288 2020/12/13 20:24:26 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -430,8 +430,9 @@
 {
        struct acpi_softc *sc = device_private(self);
        struct acpibus_attach_args *aa = aux;
-       ACPI_TABLE_HEADER *rsdt;
+       ACPI_TABLE_HEADER *rsdt, *hdr;
        ACPI_STATUS rv;
+       int i;
 
        aprint_naive("\n");
        aprint_normal(": Intel ACPICA %08x\n", ACPI_CA_VERSION);
@@ -543,6 +544,18 @@
                acpi_register_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON);
        }
 
+       /*
+        * Load drivers that operate on System Description Tables.
+        */
+       for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) {
+               rv = AcpiGetTableByIndex(i, &hdr);
+               if (ACPI_FAILURE(rv)) {
+                       continue;
+               }
+               config_found_ia(sc->sc_dev, "acpisdtbus", hdr, NULL);
+               AcpiPutTable(hdr);
+       }
+
        acpitimer_init(sc);
        acpi_config_tree(sc);
        acpi_sleep_init(sc);



Home | Main Index | Thread Index | Old Index