Source-Changes-HG archive

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

[src/trunk]: src/sys Don't use ACPI CA internal functions



details:   https://anonhg.NetBSD.org/src/rev/c51b6f747376
branches:  trunk
changeset: 559760:c51b6f747376
user:      kochi <kochi%NetBSD.org@localhost>
date:      Tue Mar 23 14:07:42 2004 +0000

description:
Don't use ACPI CA internal functions

diffstat:

 sys/arch/x86/x86/mpacpi.c |  18 ++++++------------
 sys/dev/acpi/acpi.c       |  28 +++++-----------------------
 2 files changed, 11 insertions(+), 35 deletions(-)

diffs (146 lines):

diff -r 85f99b0b1fb3 -r c51b6f747376 sys/arch/x86/x86/mpacpi.c
--- a/sys/arch/x86/x86/mpacpi.c Tue Mar 23 13:22:32 2004 +0000
+++ b/sys/arch/x86/x86/mpacpi.c Tue Mar 23 14:07:42 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpacpi.c,v 1.17 2003/11/13 23:00:54 fvdl Exp $ */
+/*     $NetBSD: mpacpi.c,v 1.18 2004/03/23 14:07:42 kochi Exp $        */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.17 2003/11/13 23:00:54 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.18 2004/03/23 14:07:42 kochi Exp $");
 
 #include "opt_acpi.h"
 #include "opt_mpbios.h"
@@ -67,9 +67,6 @@
 
 #include <dev/acpi/acpivar.h>
 #include <dev/acpi/acpi_madt.h>
-/* XXX */
-#include <dev/acpi/acpica/Subsystem/actables.h>
-#include <dev/acpi/acpica/Subsystem/acnamesp.h>
 
 #include "pci.h"
 
@@ -384,9 +381,8 @@
 mpacpi_pcibus_cb(ACPI_HANDLE handle, UINT32 level, void *ct, void **status)
 {
        ACPI_STATUS ret;
-       ACPI_NAMESPACE_NODE *node;
        ACPI_BUFFER buf;
-       ACPI_INTEGER val;
+       int val;
        struct mpacpi_pcibus *mpr;
 
        ret = acpi_get(handle, &buf, AcpiGetIrqRoutingTable);
@@ -397,10 +393,8 @@
        mpr = malloc(sizeof (struct mpacpi_pcibus), M_TEMP, M_WAITOK|M_ZERO);
        if (mpr == NULL)
                return AE_NO_MEMORY;
-       node = AcpiNsMapHandleToNode(handle);
        if (level == 1) {
-               ret = AcpiUtEvaluateNumericObject(METHOD_NAME__BBN,
-                   node, &val);
+               ret = acpi_eval_integer(handle, METHOD_NAME__BBN, &val);
                if (ACPI_FAILURE(ret)) {
                        mpr->mpr_bus = mpacpi_npciroots;
                        if (mp_verbose)
@@ -433,7 +427,7 @@
 mpacpi_pcihier_cb(ACPI_HANDLE handle, UINT32 level, void *ct, void **status)
 {
        ACPI_STATUS ret;
-       ACPI_INTEGER val;
+       int val;
        pcireg_t binf, class;
        pcitag_t tag;
        struct acpi_softc *acpi;
@@ -444,7 +438,7 @@
        mparent = mpw->mpw_mpr;
        acpi = mpw->mpw_acpi;
 
-       ret = AcpiUtEvaluateNumericObject(METHOD_NAME__ADR, handle, &val);
+       ret = acpi_eval_integer(handle, METHOD_NAME__ADR, &val);
        if (ACPI_FAILURE(ret))
                return AE_OK;
 
diff -r 85f99b0b1fb3 -r c51b6f747376 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Tue Mar 23 13:22:32 2004 +0000
+++ b/sys/dev/acpi/acpi.c       Tue Mar 23 14:07:42 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.57 2003/11/03 18:51:31 mycroft Exp $        */
+/*     $NetBSD: acpi.c,v 1.58 2004/03/23 14:08:17 kochi Exp $  */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.57 2003/11/03 18:51:31 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.58 2004/03/23 14:08:17 kochi Exp $");
 
 #include "opt_acpi.h"
 
@@ -97,7 +97,6 @@
 #endif
 
 #ifdef ACPI_PCI_FIXUP
-#include <dev/acpi/acpica/Subsystem/acnamesp.h> /* AcpiNsGetNodeByPath() */
 #include <dev/pci/pcidevs.h>
 #endif
 
@@ -1011,21 +1010,6 @@
            acpi_pci_fixup_bus, sc, NULL);
 }
 
-static ACPI_HANDLE
-acpi_get_node(char *name)
-{
-       ACPI_NAMESPACE_NODE *ObjDesc;
-       ACPI_STATUS Status;
-
-       Status = AcpiNsGetNodeByPath(name, NULL, 0, &ObjDesc);
-       if (ACPI_FAILURE (Status)) {
-               printf("acpi_get_node: could not find: %s\n",
-                      AcpiFormatException (Status));
-               return NULL;
-       }
-       return ObjDesc;
-}
-
 static uint
 acpi_get_intr(ACPI_HANDLE handle)
 {
@@ -1119,7 +1103,6 @@
        ACPI_PCI_ROUTING_TABLE *PrtElement;
        ACPI_HANDLE link;
        uint line;
-       ACPI_NAMESPACE_NODE *node;
        ACPI_INTEGER val;
 
        rv = acpi_get(handle, &buf, AcpiGetIrqRoutingTable);
@@ -1134,8 +1117,7 @@
         * case should be ok, so we'll ignore that.
         */
        if (level == 1) {
-               node = AcpiNsMapHandleToNode(handle);
-               rv = AcpiUtEvaluateNumericObject(METHOD_NAME__BBN, node, &val);
+               rv = acpi_eval_integer(handle, METHOD_NAME__BBN, &val);
                if (!ACPI_FAILURE(rv)) {
 #ifdef ACPI_DEBUG
                        printf("%s: fixup: _BBN success, bus # was %d now %d\n",
@@ -1159,8 +1141,8 @@
                if (PrtElement->Source[0] == 0)
                        continue;
 
-               link = acpi_get_node(PrtElement->Source);
-               if (link == NULL)
+               rv = AcpiGetHandle(NULL, PrtElement->Source, &link);
+               if (ACPI_FAILURE(rv))
                        continue;
                line = acpi_get_intr(link);
                if (line == -1) {



Home | Main Index | Thread Index | Old Index