Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/rump/librump/rumpkern Pull up following revision(s) (...



details:   https://anonhg.NetBSD.org/src/rev/68885ad4996a
branches:  netbsd-6
changeset: 775647:68885ad4996a
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Feb 08 20:48:12 2013 +0000

description:
Pull up following revision(s) (requested by rmind in ticket #794):
        sys/rump/librump/rumpkern/emul.c: revision 1.152
Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism.  It is emulated using low-priority xcall(9).

diffstat:

 sys/rump/librump/rumpkern/emul.c |  31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r 943ebe78f514 -r 68885ad4996a sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c  Fri Feb 08 20:45:50 2013 +0000
+++ b/sys/rump/librump/rumpkern/emul.c  Fri Feb 08 20:48:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emul.c,v 1.150 2011/03/21 16:41:08 pooka Exp $ */
+/*     $NetBSD: emul.c,v 1.150.10.1 2013/02/08 20:48:12 riz Exp $      */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.150 2011/03/21 16:41:08 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.150.10.1 2013/02/08 20:48:12 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/null.h>
@@ -284,9 +284,32 @@
 void
 xc_send_ipi(struct cpu_info *ci)
 {
+       const struct cpu_info *curci = curcpu();
+       CPU_INFO_ITERATOR cii;
 
-       /* I'll think about the implementation if this is ever used */
-       panic("not implemented");
+       /*
+        * IPI are considered asynchronous, therefore no need to wait for
+        * unicast call delivery (nor the order of calls matters).  Our LWP
+        * needs to be bound to the CPU, since xc_unicast(9) may block.
+        *
+        * WARNING: These must be low-priority calls, as this routine is
+        * used to emulate high-priority (XC_HIGHPRI) mechanism.
+        */
+
+       if (ci) {
+               KASSERT(curci != ci);
+               (void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
+               return;
+       }
+
+       curlwp->l_pflag |= LP_BOUND;
+       for (CPU_INFO_FOREACH(cii, ci)) {
+               if (curci == ci) {
+                       continue;
+               }
+               (void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
+       }
+       curlwp->l_pflag &= ~LP_BOUND;
 }
 
 int



Home | Main Index | Thread Index | Old Index