Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode add heavyweight sigprocmask stuff...



details:   https://anonhg.NetBSD.org/src/rev/828caf08717f
branches:  trunk
changeset: 769390:828caf08717f
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Sep 08 11:13:03 2011 +0000

description:
add heavyweight sigprocmask stuff, commented out unless INTR_USE_SIGPROCMASK
is defined

diffstat:

 sys/arch/usermode/usermode/intr.c |  27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diffs (60 lines):

diff -r 75292120fcc2 -r 828caf08717f sys/arch/usermode/usermode/intr.c
--- a/sys/arch/usermode/usermode/intr.c Thu Sep 08 11:11:18 2011 +0000
+++ b/sys/arch/usermode/usermode/intr.c Thu Sep 08 11:13:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.3 2011/09/05 18:17:44 jmcneill Exp $ */
+/* $NetBSD: intr.c,v 1.4 2011/09/08 11:13:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,22 +27,36 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3 2011/09/05 18:17:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.4 2011/09/08 11:13:03 jmcneill Exp $");
 
 #include <sys/types.h>
 
 #include <machine/intr.h>
 #include <machine/thunk.h>
 
+/* #define INTR_USE_SIGPROCMASK */
+
 static int usermode_x = IPL_NONE;
 
+#ifdef INTR_USE_SIGPROCMASK
+static bool block_sigalrm = false;
+#endif
+
 int
 splraise(int x)
 {
        int oldx = usermode_x;
 
-       if (x > usermode_x)
+       if (x > usermode_x) {
                usermode_x = x;
+       }
+
+#ifdef INTR_USE_SIGPROCMASK
+       if (x >= IPL_SCHED && !block_sigalrm) {
+               thunk_sigblock(SIGALRM);
+               block_sigalrm = true;
+       }
+#endif
 
        return oldx;
 }
@@ -52,4 +66,11 @@
 {
        if (usermode_x > x)
                usermode_x = x;
+
+#ifdef INTR_USE_SIGPROCMASK
+       if (x < IPL_SCHED && block_sigalrm) {
+               thunk_sigunblock(SIGALRM);
+               block_sigalrm = false;
+       }
+#endif
 }



Home | Main Index | Thread Index | Old Index