Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/broadcom mark ISR as mpsafe, detect when this i...



details:   https://anonhg.NetBSD.org/src/rev/574aa438ccc3
branches:  trunk
changeset: 825813:574aa438ccc3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Jul 31 23:54:19 2017 +0000

description:
mark ISR as mpsafe, detect when this is the console

diffstat:

 sys/arch/arm/broadcom/bcm2835_com.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r a019f1d4b842 -r 574aa438ccc3 sys/arch/arm/broadcom/bcm2835_com.c
--- a/sys/arch/arm/broadcom/bcm2835_com.c       Mon Jul 31 23:53:25 2017 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_com.c       Mon Jul 31 23:54:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_com.c,v 1.2 2017/07/31 00:51:20 jmcneill Exp $ */
+/* $NetBSD: bcm2835_com.c,v 1.3 2017/07/31 23:54:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.2 2017/07/31 00:51:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.3 2017/07/31 23:54:19 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -77,7 +77,8 @@
        }
        sc->sc_frequency *= 2;
 
-       if (bus_space_map(bst, aaa->aaa_addr, aaa->aaa_size, 0, &bsh) != 0) {
+       if (com_is_console(bst, aaa->aaa_addr, &bsh) == 0 &&
+           bus_space_map(bst, aaa->aaa_addr, aaa->aaa_size, 0, &bsh) != 0) {
                aprint_error(": can't map device\n");
                return;
        }
@@ -87,7 +88,8 @@
        com_attach_subr(sc);
        aprint_naive("\n");
 
-       ih = intr_establish(aaa->aaa_intr, IPL_SERIAL, IST_LEVEL, comintr, sc);
+       ih = intr_establish(aaa->aaa_intr, IPL_SERIAL, IST_LEVEL | IST_MPSAFE,
+           comintr, sc);
        if (ih == NULL) {
                aprint_error_dev(self, "failed to establish interrupt %d\n",
                    aaa->aaa_intr);



Home | Main Index | Thread Index | Old Index