Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Implement acpi_md_intr_mask and acpi_md_intr_un...



details:   https://anonhg.NetBSD.org/src/rev/1f6e32de4249
branches:  trunk
changeset: 847458:1f6e32de4249
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Dec 23 15:34:23 2019 +0000

description:
Implement acpi_md_intr_mask and acpi_md_intr_unmask

diffstat:

 sys/arch/arm/acpi/acpi_machdep.c |  10 ++++------
 sys/arch/arm/pic/pic.c           |  24 ++++++++++++++++++++++--
 sys/arch/arm/pic/picvar.h        |   4 +++-
 3 files changed, 29 insertions(+), 9 deletions(-)

diffs (99 lines):

diff -r c422f5bb662f -r 1f6e32de4249 sys/arch/arm/acpi/acpi_machdep.c
--- a/sys/arch/arm/acpi/acpi_machdep.c  Mon Dec 23 15:31:31 2019 +0000
+++ b/sys/arch/arm/acpi/acpi_machdep.c  Mon Dec 23 15:34:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.12 2019/12/23 15:34:23 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.11 2019/12/22 15:57:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.12 2019/12/23 15:34:23 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -259,15 +259,13 @@
 void
 acpi_md_intr_mask(void *ih)
 {
-       /* XXX */
-       panic("acpi_md_intr_mask(%p): not implemented", ih);
+       intr_mask(ih);
 }
 
 void
 acpi_md_intr_unmask(void *ih)
 {
-       /* XXX */
-       panic("acpi_md_intr_unmask(%p): not implemented", ih);
+       intr_unmask(ih);
 }
 
 void
diff -r c422f5bb662f -r 1f6e32de4249 sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c    Mon Dec 23 15:31:31 2019 +0000
+++ b/sys/arch/arm/pic/pic.c    Mon Dec 23 15:34:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic.c,v 1.48 2018/11/16 15:06:22 jmcneill Exp $        */
+/*     $NetBSD: pic.c,v 1.49 2019/12/23 15:34:23 jmcneill Exp $        */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.48 2018/11/16 15:06:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.49 2019/12/23 15:34:23 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -902,6 +902,26 @@
        pic_disestablish_source(is);
 }
 
+void
+intr_mask(void *ih)
+{
+       struct intrsource * const is = ih;
+       struct pic_softc * const pic = is->is_pic;
+       const int irq = is->is_irq;
+
+       (*pic->pic_ops->pic_block_irqs)(pic, irq & ~0x1f, __BIT(irq & 0x1f));
+}
+
+void
+intr_unmask(void *ih)
+{
+       struct intrsource * const is = ih;
+       struct pic_softc * const pic = is->is_pic;
+       const int irq = is->is_irq;
+
+       (*pic->pic_ops->pic_unblock_irqs)(pic, irq & ~0x1f, __BIT(irq & 0x1f));
+}
+
 const char *
 intr_string(intr_handle_t irq, char *buf, size_t len)
 {
diff -r c422f5bb662f -r 1f6e32de4249 sys/arch/arm/pic/picvar.h
--- a/sys/arch/arm/pic/picvar.h Mon Dec 23 15:31:31 2019 +0000
+++ b/sys/arch/arm/pic/picvar.h Mon Dec 23 15:34:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: picvar.h,v 1.23 2019/03/27 07:29:29 ryo Exp $  */
+/*     $NetBSD: picvar.h,v 1.24 2019/12/23 15:34:23 jmcneill Exp $     */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -90,6 +90,8 @@
 void   *intr_establish_xname(int irq, int ipl, int type, int (*func)(void *),
            void *arg, const char *xname);
 void   intr_disestablish(void *);
+void   intr_mask(void *);
+void   intr_unmask(void *);
 const char *intr_string(intr_handle_t, char *, size_t);
 #ifdef MULTIPROCESSOR
 void   intr_cpu_init(struct cpu_info *);



Home | Main Index | Thread Index | Old Index