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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user