Module Name:    src
Committed By:   rmind
Date:           Thu Jun  5 23:43:04 UTC 2014

Modified Files:
        src/sys/rump/librump/rumpkern: intr.c scheduler.c

Log Message:
librump: add kpreempt_disabled(9) and softint_schedule_cpu(9).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/librump/rumpkern/intr.c
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/librump/rumpkern/scheduler.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/intr.c
diff -u src/sys/rump/librump/rumpkern/intr.c:1.42 src/sys/rump/librump/rumpkern/intr.c:1.43
--- src/sys/rump/librump/rumpkern/intr.c:1.42	Mon Nov 11 23:11:30 2013
+++ src/sys/rump/librump/rumpkern/intr.c	Thu Jun  5 23:43:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.42 2013/11/11 23:11:30 pooka Exp $	*/
+/*	$NetBSD: intr.c,v 1.43 2014/06/05 23:43:04 rmind Exp $	*/
 
 /*
  * Copyright (c) 2008-2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.42 2013/11/11 23:11:30 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.43 2014/06/05 23:43:04 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -324,6 +324,14 @@ softint_schedule(void *arg)
 	}
 }
 
+void
+softint_schedule_cpu(void *arg, struct cpu_info *ci)
+{
+	/* TODO: implement this properly */
+	KASSERT(curcpu() == ci);
+	softint_schedule(arg);
+}
+
 /*
  * flimsy disestablish: should wait for softints to finish.
  */

Index: src/sys/rump/librump/rumpkern/scheduler.c
diff -u src/sys/rump/librump/rumpkern/scheduler.c:1.37 src/sys/rump/librump/rumpkern/scheduler.c:1.38
--- src/sys/rump/librump/rumpkern/scheduler.c:1.37	Wed Apr  9 23:53:36 2014
+++ src/sys/rump/librump/rumpkern/scheduler.c	Thu Jun  5 23:43:04 2014
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.37 2014/04/09 23:53:36 pooka Exp $	*/
+/*      $NetBSD: scheduler.c,v 1.38 2014/06/05 23:43:04 rmind Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.37 2014/04/09 23:53:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.38 2014/06/05 23:43:04 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -523,6 +523,15 @@ kpreempt_enable(void)
 	KPREEMPT_ENABLE(curlwp);
 }
 
+bool
+kpreempt_disabled(void)
+{
+	const lwp_t *l = curlwp;
+
+	return l->l_nopreempt != 0 || l->l_stat == LSZOMB ||
+	    (l->l_flag & LW_IDLE) != 0 /* || cpu_kpreempt_disabled() */;
+}
+
 void
 suspendsched(void)
 {

Reply via email to