SMP - runctl() can stop across cpus

- if stopping a process that runs on a different CPU we tell the
  remote cpu to do that
This commit is contained in:
Tomas Hruby
2010-09-15 14:11:09 +00:00
parent e2701da5a9
commit 906a81a1c7
3 changed files with 51 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "kernel/system.h"
#include <assert.h>
#if USE_RUNCTL
@@ -51,7 +52,15 @@ PUBLIC int do_runctl(struct proc * caller, message * m_ptr)
/* Either set or clear the stop flag. */
switch (action) {
case RC_STOP:
RTS_SET(rp, RTS_PROC_STOP);
#if CONFIG_SMP
/* check if we must stop a process on a different CPU */
if (rp->p_cpu != cpuid) {
smp_schedule_stop_proc(rp);
assert(RTS_ISSET(rp, RTS_PROC_STOP));
break;
}
#endif
RTS_SET(rp, RTS_PROC_STOP);
break;
case RC_RESUME:
RTS_UNSET(rp, RTS_PROC_STOP);