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 ACPI_REDUCED_HARDWARE defflag (used by ACPI...



details:   https://anonhg.NetBSD.org/src/rev/7ef4370858db
branches:  trunk
changeset: 445175:7ef4370858db
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Oct 16 00:30:08 2018 +0000

description:
Add ACPI_REDUCED_HARDWARE defflag (used by ACPICA) and fix acpi build with this option set.

diffstat:

 sys/dev/acpi/acpi.c       |  11 +++++++----
 sys/dev/acpi/acpi_timer.c |  17 ++++++++++++++---
 sys/dev/acpi/files.acpi   |   4 ++--
 3 files changed, 23 insertions(+), 9 deletions(-)

diffs (127 lines):

diff -r 8b9584ad8226 -r 7ef4370858db sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Tue Oct 16 00:10:58 2018 +0000
+++ b/sys/dev/acpi/acpi.c       Tue Oct 16 00:30:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.274 2018/10/12 21:35:54 jmcneill Exp $      */
+/*     $NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 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.274 2018/10/12 21:35:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.275 2018/10/16 00:30:08 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -525,8 +525,9 @@
        acpi_active = 1;
 
        /* Show SCI interrupt. */
-       aprint_verbose_dev(self, "SCI interrupting at int %u\n",
-           AcpiGbl_FADT.SciInterrupt);
+       if (AcpiGbl_FADT.SciInterrupt != 0)
+               aprint_verbose_dev(self, "SCI interrupting at int %u\n",
+                   AcpiGbl_FADT.SciInterrupt);
 
        /*
         * Install fixed-event handlers.
@@ -1409,7 +1410,9 @@
                        AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
                        AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
                        AcpiClearEvent(ACPI_EVENT_RTC);
+#if !defined(ACPI_REDUCED_HARDWARE)
                        AcpiHwDisableAllGpes();
+#endif
 
                        acpi_md_OsEnableInterrupt();
                        rv = AcpiLeaveSleepState(state);
diff -r 8b9584ad8226 -r 7ef4370858db sys/dev/acpi/acpi_timer.c
--- a/sys/dev/acpi/acpi_timer.c Tue Oct 16 00:10:58 2018 +0000
+++ b/sys/dev/acpi/acpi_timer.c Tue Oct 16 00:30:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $ */
+/* $NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2006 Matthias Drochner <drochner%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.23 2018/10/15 11:33:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_timer.c,v 1.24 2018/10/16 00:30:08 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -39,6 +39,7 @@
 
 #include <machine/acpi_machdep.h>
 
+#if !defined(ACPI_REDUCED_HARDWARE)
 static int     acpitimer_test(void);
 
 static struct timecounter acpi_timecounter = {
@@ -57,10 +58,12 @@
 {
        return AcpiGbl_FADT.PmTimerLength != 0;
 }
+#endif
 
 int
 acpitimer_init(struct acpi_softc *sc)
 {
+#if !defined(ACPI_REDUCED_HARDWARE)
        ACPI_STATUS rv;
        uint32_t bits;
        int i, j;
@@ -91,18 +94,25 @@
            acpi_timecounter.tc_name, bits);
 
        return 0;
+#else
+       return -1;
+#endif
 }
 
 int
 acpitimer_detach(void)
 {
-
+#if !defined(ACPI_REDUCED_HARDWARE)
        if (!acpitimer_supported())
                return -1;
 
        return tc_detach(&acpi_timecounter);
+#else
+       return -1;
+#endif
 }
 
+#if !defined(ACPI_REDUCED_HARDWARE)
 u_int
 acpitimer_read_fast(struct timecounter *tc)
 {
@@ -190,3 +200,4 @@
 
        return n;
 }
+#endif
diff -r 8b9584ad8226 -r 7ef4370858db sys/dev/acpi/files.acpi
--- a/sys/dev/acpi/files.acpi   Tue Oct 16 00:10:58 2018 +0000
+++ b/sys/dev/acpi/files.acpi   Tue Oct 16 00:30:08 2018 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: files.acpi,v 1.104 2018/10/15 23:59:16 jmcneill Exp $
+#      $NetBSD: files.acpi,v 1.105 2018/10/16 00:30:08 jmcneill Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
 defflag        opt_acpi.h      ACPIVERBOSE ACPI_DEBUG ACPI_ACTIVATE_DEV
                        ACPI_DSDT_OVERRIDE ACPI_SCANPCI ACPI_BREAKPOINT
-                       ACPI__DIS_IS_BROKEN
+                       ACPI_REDUCED_HARDWARE ACPI__DIS_IS_BROKEN
 defparam opt_acpi.h    ACPI_DSDT_FILE := "\"/dev/null\""
 defparam opt_acpi.h    ACPI_BLACKLIST_YEAR = 2000
 



Home | Main Index | Thread Index | Old Index