summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2017-05-17 11:52:25 +0000
committervisa <visa@openbsd.org>2017-05-17 11:52:25 +0000
commit8aa1a2d25e7bfd411659cbc43bb7bf8ed1926ce0 (patch)
tree6b133b603170ef157212bf61f54497316b4e7402
parentProtect the global list of interfaces with the NET_LOCK(). (diff)
downloadwireguard-openbsd-8aa1a2d25e7bfd411659cbc43bb7bf8ed1926ce0.tar.xz
wireguard-openbsd-8aa1a2d25e7bfd411659cbc43bb7bf8ed1926ce0.zip
Make IPL_MPSAFE effective on loongson.
Testing help from fcambus@
-rw-r--r--sys/arch/loongson/dev/bonito.c4
-rw-r--r--sys/arch/loongson/dev/voyager.c4
-rw-r--r--sys/arch/loongson/include/intr.h4
3 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/loongson/dev/bonito.c b/sys/arch/loongson/dev/bonito.c
index 0a0a1a42feb..70aa60ff798 100644
--- a/sys/arch/loongson/dev/bonito.c
+++ b/sys/arch/loongson/dev/bonito.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bonito.c,v 1.32 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: bonito.c,v 1.33 2017/05/17 11:52:25 visa Exp $ */
/* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */
@@ -399,6 +399,8 @@ bonito_intr_establish(int irq, int type, int level, int (*handler)(void *),
panic("bonito_intr_establish: illegal irq %d", irq);
#endif
+ level &= ~IPL_MPSAFE;
+
ih = malloc(sizeof *ih, M_DEVBUF, M_NOWAIT);
if (ih == NULL)
return NULL;
diff --git a/sys/arch/loongson/dev/voyager.c b/sys/arch/loongson/dev/voyager.c
index 19b0b15543c..d6ce092982b 100644
--- a/sys/arch/loongson/dev/voyager.c
+++ b/sys/arch/loongson/dev/voyager.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: voyager.c,v 1.4 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: voyager.c,v 1.5 2017/05/17 11:52:25 visa Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -244,6 +244,8 @@ voyager_intr_establish(void *cookie, int irq, int level, int (*fun)(void *),
return NULL;
#endif
+ level &= ~IPL_MPSAFE;
+
nh = (struct intrhand *)malloc(sizeof *nh, M_DEVBUF, M_NOWAIT | M_ZERO);
if (nh == NULL)
return NULL;
diff --git a/sys/arch/loongson/include/intr.h b/sys/arch/loongson/include/intr.h
index cbd81ff538d..1e7905d8d6c 100644
--- a/sys/arch/loongson/include/intr.h
+++ b/sys/arch/loongson/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.12 2017/02/19 08:59:41 visa Exp $ */
+/* $OpenBSD: intr.h,v 1.13 2017/05/17 11:52:25 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -63,7 +63,7 @@
#define IPL_MPFLOOR IPL_TTY
/* Interrupt priority 'flags'. */
-#define IPL_MPSAFE 0 /* no "mpsafe" interrupts */
+#define IPL_MPSAFE 0x100
/* Interrupt sharing types. */
#define IST_NONE 0 /* none */