Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi When ACPI is not present, free any resources us...



details:   https://anonhg.NetBSD.org/src/rev/477ff4ff31a4
branches:  trunk
changeset: 746914:477ff4ff31a4
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Aug 23 15:16:16 2009 +0000

description:
When ACPI is not present, free any resources used by the ACPICA. Also,
no need to complain (unless we're debugging) that ACPI is not present.

diffstat:

 sys/dev/acpi/acpi.c                  |  15 +++++++++++++--
 sys/dev/acpi/acpi_osd.h              |   3 +--
 sys/dev/acpi/acpica/OsdEnvironment.c |   7 ++-----
 sys/dev/acpi/acpica/OsdSchedule.c    |  15 ++-------------
 4 files changed, 18 insertions(+), 22 deletions(-)

diffs (171 lines):

diff -r 810e792206b0 -r 477ff4ff31a4 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Sun Aug 23 14:54:52 2009 +0000
+++ b/sys/dev/acpi/acpi.c       Sun Aug 23 15:16:16 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.129 2009/08/18 21:38:41 cegger Exp $        */
+/*     $NetBSD: acpi.c,v 1.130 2009/08/23 15:16:16 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.129 2009/08/18 21:38:41 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.130 2009/08/23 15:16:16 jmcneill Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -244,8 +244,11 @@
 
        rv = AcpiInitializeTables(acpi_initial_tables, 128, 0);
        if (ACPI_FAILURE(rv)) {
+#ifdef ACPI_DEBUG
                printf("ACPI: unable to initialize ACPI tables: %s\n",
                    AcpiFormatException(rv));
+#endif
+               AcpiTerminate();
                return 0;
        }
 
@@ -253,6 +256,7 @@
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unable to reallocate root table: %s\n",
                    AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
 
@@ -265,12 +269,14 @@
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unable to load tables: %s\n",
                    AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
 
        rsdt = acpi_map_rsdt();
        if (rsdt == NULL) {
                printf("ACPI: unable to map RSDT\n");
+               AcpiTerminate();
                return 0;
        }
 
@@ -284,6 +290,7 @@
                        rsdt->AslCompilerRevision);
                printf("ACPI: not used. set acpi_force_load to use anyway.\n");
                acpi_unmap_rsdt(rsdt);
+               AcpiTerminate();
                return 0;
        }
 
@@ -296,6 +303,7 @@
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unable to initialise SystemMemory handler: %s\n",
                    AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
        rv = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
@@ -303,6 +311,7 @@
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unable to initialise SystemIO handler: %s\n",
                     AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
        rv = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
@@ -310,6 +319,7 @@
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unabled to initialise PciConfig handler: %s\n",
                    AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
 #endif
@@ -317,6 +327,7 @@
        rv = AcpiEnableSubsystem(~(ACPI_NO_HARDWARE_INIT|ACPI_NO_ACPI_ENABLE));
        if (ACPI_FAILURE(rv)) {
                printf("ACPI: unable to enable: %s\n", AcpiFormatException(rv));
+               AcpiTerminate();
                return 0;
        }
 
diff -r 810e792206b0 -r 477ff4ff31a4 sys/dev/acpi/acpi_osd.h
--- a/sys/dev/acpi/acpi_osd.h   Sun Aug 23 14:54:52 2009 +0000
+++ b/sys/dev/acpi/acpi_osd.h   Sun Aug 23 15:16:16 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_osd.h,v 1.1 2001/09/28 02:09:23 thorpej Exp $     */
+/*     $NetBSD: acpi_osd.h,v 1.2 2009/08/23 15:16:16 jmcneill Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -45,4 +45,3 @@
 
 /* Osd/OsdSchedule.c */
 void   acpi_osd_sched_init(void);
-void   acpi_osd_sched_fini(void);
diff -r 810e792206b0 -r 477ff4ff31a4 sys/dev/acpi/acpica/OsdEnvironment.c
--- a/sys/dev/acpi/acpica/OsdEnvironment.c      Sun Aug 23 14:54:52 2009 +0000
+++ b/sys/dev/acpi/acpica/OsdEnvironment.c      Sun Aug 23 15:16:16 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdEnvironment.c,v 1.4 2009/08/18 16:41:02 jmcneill Exp $      */
+/*     $NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.4 2009/08/18 16:41:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $");
 
 #include <sys/types.h>
 
@@ -77,9 +77,6 @@
 ACPI_STATUS
 AcpiOsTerminate(void)
 {
-       /* Tear down the Osd Scheduler. */
-       acpi_osd_sched_fini();
-
        return acpi_md_OsTerminate();
 }
 
diff -r 810e792206b0 -r 477ff4ff31a4 sys/dev/acpi/acpica/OsdSchedule.c
--- a/sys/dev/acpi/acpica/OsdSchedule.c Sun Aug 23 14:54:52 2009 +0000
+++ b/sys/dev/acpi/acpica/OsdSchedule.c Sun Aug 23 15:16:16 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdSchedule.c,v 1.11 2009/08/18 16:41:02 jmcneill Exp $        */
+/*     $NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $        */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.11 2009/08/18 16:41:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -80,17 +80,6 @@
 }
 
 /*
- * acpi_osd_sched_fini:
- *
- *     Clean up the ACPICA Osd scheduler.  Called from AcpiOsdTerminate().
- */
-void
-acpi_osd_sched_fini(void)
-{
-       sysmon_task_queue_fini();
-}
-
-/*
  * AcpiOsGetThreadId:
  *
  *     Obtain the ID of the currently executing thread.



Home | Main Index | Thread Index | Old Index