Module Name:    src
Committed By:   jmcneill
Date:           Mon Dec 23 15:34:23 UTC 2019

Modified Files:
        src/sys/arch/arm/acpi: acpi_machdep.c
        src/sys/arch/arm/pic: pic.c picvar.h

Log Message:
Implement acpi_md_intr_mask and acpi_md_intr_unmask


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/acpi/acpi_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/pic/picvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.11 src/sys/arch/arm/acpi/acpi_machdep.c:1.12
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.11	Sun Dec 22 15:57:06 2019
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Mon Dec 23 15:34:23 2019
@@ -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 @@ acpi_md_intr_establish(uint32_t irq, int
 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

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.48 src/sys/arch/arm/pic/pic.c:1.49
--- src/sys/arch/arm/pic/pic.c:1.48	Fri Nov 16 15:06:22 2018
+++ src/sys/arch/arm/pic/pic.c	Mon Dec 23 15:34:23 2019
@@ -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 @@ intr_disestablish(void *ih)
 	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)
 {

Index: src/sys/arch/arm/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.23 src/sys/arch/arm/pic/picvar.h:1.24
--- src/sys/arch/arm/pic/picvar.h:1.23	Wed Mar 27 07:29:29 2019
+++ src/sys/arch/arm/pic/picvar.h	Mon Dec 23 15:34:23 2019
@@ -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(int irq, int ipl, i
 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 *);

Reply via email to