Source-Changes-HG archive

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

[src/trunk]: src/sys Add acpi_intr_mask() and acpi_intr_unmask() which, follo...



details:   https://anonhg.NetBSD.org/src/rev/620605664942
branches:  trunk
changeset: 847421:620605664942
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Dec 22 15:57:06 2019 +0000

description:
Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.

diffstat:

 sys/arch/arm/acpi/acpi_machdep.c     |  18 ++++++++++++++++--
 sys/arch/arm/include/acpi_machdep.h  |   4 +++-
 sys/arch/ia64/acpi/acpi_machdep.c    |  18 ++++++++++++++++--
 sys/arch/ia64/include/acpi_machdep.h |   4 +++-
 sys/arch/x86/acpi/acpi_machdep.c     |  16 ++++++++++++++--
 sys/arch/x86/include/acpi_machdep.h  |   4 +++-
 sys/dev/acpi/acpi_intr.h             |  10 +++++++++-
 sys/dev/acpi/acpi_util.c             |  20 ++++++++++++++++++--
 8 files changed, 82 insertions(+), 12 deletions(-)

diffs (235 lines):

diff -r 6cad1cdf8295 -r 620605664942 sys/arch/arm/acpi/acpi_machdep.c
--- a/sys/arch/arm/acpi/acpi_machdep.c  Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/arm/acpi/acpi_machdep.c  Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.10 2019/08/12 15:37:26 skrll Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej 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.10 2019/08/12 15:37:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -257,6 +257,20 @@
 }
 
 void
+acpi_md_intr_mask(void *ih)
+{
+       /* XXX */
+       panic("acpi_md_intr_mask(%p): not implemented", ih);
+}
+
+void
+acpi_md_intr_unmask(void *ih)
+{
+       /* XXX */
+       panic("acpi_md_intr_unmask(%p): not implemented", ih);
+}
+
+void
 acpi_md_intr_disestablish(void *ih)
 {
        intr_disestablish(ih);
diff -r 6cad1cdf8295 -r 620605664942 sys/arch/arm/include/acpi_machdep.h
--- a/sys/arch/arm/include/acpi_machdep.h       Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/arm/include/acpi_machdep.h       Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.h,v 1.2 2018/11/16 23:03:55 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.h,v 1.3 2019/12/22 15:57:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -48,6 +48,8 @@
 void                   acpi_md_OsDisableInterrupt(void);
 void *                 acpi_md_intr_establish(uint32_t, int, int, int (*)(void *),
                                               void *, bool, const char *);
+void                   acpi_md_intr_mask(void *);
+void                   acpi_md_intr_unmask(void *);
 void                   acpi_md_intr_disestablish(void *);
 int                    acpi_md_sleep(int);
 uint32_t               acpi_md_pdc(void);
diff -r 6cad1cdf8295 -r 620605664942 sys/arch/ia64/acpi/acpi_machdep.c
--- a/sys/arch/ia64/acpi/acpi_machdep.c Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/ia64/acpi/acpi_machdep.c Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $   */
+/*     $NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $        */
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -28,7 +28,7 @@
  * Machine-dependent routines for ACPICA.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $");
 
 #include <sys/param.h>
 
@@ -126,6 +126,20 @@
 }
 
 void
+acpi_md_intr_mask(void *ih)
+{
+       /* XXX */
+       panic("acpi_md_intr_mask(%p): not implemented", ih);
+}
+
+void
+acpi_md_intr_unmask(void *ih)
+{
+       /* XXX */
+       panic("acpi_md_intr_unmask(%p): not implemented", ih);
+}
+
+void
 acpi_md_intr_disestablish(void *ih)
 {
        intr_disestablish(ih);
diff -r 6cad1cdf8295 -r 620605664942 sys/arch/ia64/include/acpi_machdep.h
--- a/sys/arch/ia64/include/acpi_machdep.h      Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/ia64/include/acpi_machdep.h      Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.h,v 1.8 2018/11/16 23:03:55 jmcneill Exp $        */
+/*     $NetBSD: acpi_machdep.h,v 1.9 2019/12/22 15:57:07 thorpej Exp $ */
 
 ACPI_STATUS            acpi_md_OsInitialize(void);
 ACPI_PHYSICAL_ADDRESS  acpi_md_OsGetRootPointer(void);
@@ -27,6 +27,8 @@
 
 void *         acpi_md_intr_establish(uint32_t, int, int, int (*)(void *),
                                       void *, bool, const char *);
+void           acpi_md_intr_mask(void *);
+void           acpi_md_intr_unmask(void *);
 void           acpi_md_intr_disestablish(void *);
 
 int            acpi_md_sleep(int);
diff -r 6cad1cdf8295 -r 620605664942 sys/arch/x86/acpi/acpi_machdep.c
--- a/sys/arch/x86/acpi/acpi_machdep.c  Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/x86/acpi/acpi_machdep.c  Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.29 2019/12/22 15:57:07 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.29 2019/12/22 15:57:07 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -353,6 +353,18 @@
 }
 
 void
+acpi_md_intr_mask(void *ih)
+{
+       intr_mask(ih);
+}
+
+void
+acpi_md_intr_unmask(void *ih)
+{
+       intr_unmask(ih);
+}
+
+void
 acpi_md_intr_disestablish(void *ih)
 {
        intr_disestablish(ih);
diff -r 6cad1cdf8295 -r 620605664942 sys/arch/x86/include/acpi_machdep.h
--- a/sys/arch/x86/include/acpi_machdep.h       Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/arch/x86/include/acpi_machdep.h       Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.h,v 1.13 2018/11/16 23:03:55 jmcneill Exp $       */
+/*     $NetBSD: acpi_machdep.h,v 1.14 2019/12/22 15:57:07 thorpej Exp $        */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -72,6 +72,8 @@
 
 void *         acpi_md_intr_establish(uint32_t, int, int, int (*)(void *),
                    void *, bool, const char *);
+void           acpi_md_intr_mask(void *);
+void           acpi_md_intr_unmask(void *);
 void           acpi_md_intr_disestablish(void *);
 
 int            acpi_md_sleep(int);
diff -r 6cad1cdf8295 -r 620605664942 sys/dev/acpi/acpi_intr.h
--- a/sys/dev/acpi/acpi_intr.h  Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/dev/acpi/acpi_intr.h  Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_intr.h,v 1.3 2018/11/16 23:05:50 jmcneill Exp $ */
+/* $NetBSD: acpi_intr.h,v 1.4 2019/12/22 15:57:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -28,7 +28,15 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+
+#ifndef _DEV_ACPI_ACPI_INTR_H_
+#define        _DEV_ACPI_ACPI_INTR_H_
+
 void *         acpi_intr_establish(device_t, uint64_t, int, bool,
                    int (*intr)(void *), void *, const char *);
+void           acpi_intr_mask(void *);
+void           acpi_intr_unmask(void *);
 void           acpi_intr_disestablish(void *);
 const char *   acpi_intr_string(void *, char *, size_t len);
+
+#endif /* _DEV_ACPI_ACPI_INTR_H_ */
diff -r 6cad1cdf8295 -r 620605664942 sys/dev/acpi/acpi_util.c
--- a/sys/dev/acpi/acpi_util.c  Sun Dec 22 15:15:20 2019 +0000
+++ b/sys/dev/acpi/acpi_util.c  Sun Dec 22 15:57:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $ */
+/*     $NetBSD: acpi_util.c,v 1.16 2019/12/22 15:57:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.16 2019/12/22 15:57:07 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -591,6 +591,22 @@
 }
 
 void
+acpi_intr_mask(void *c)
+{
+       struct acpi_irq_handler * const aih = c;
+
+       acpi_md_intr_mask(aih->aih_ih);
+}
+
+void
+acpi_intr_unmask(void *c)
+{
+       struct acpi_irq_handler * const aih = c;
+
+       acpi_md_intr_unmask(aih->aih_ih);
+}
+
+void
 acpi_intr_disestablish(void *c)
 {
        struct acpi_irq_handler *aih = c;



Home | Main Index | Thread Index | Old Index