#include "kernel/system.h"
#include "kernel/ipc.h"
#include <string.h>
+#include <assert.h>
#if USE_UPDATE
return EPERM;
}
+ assert(!proc_is_runnable(src_rp) && !proc_is_runnable(dst_rp));
+
/* Check if processes are updatable. */
if(!proc_is_updatable(src_rp) || !proc_is_updatable(dst_rp)) {
return EBUSY;
rp->p_priv = from_rp->p_priv;
priv(rp)->s_proc_nr = from_rp->p_nr;
rp->p_caller_q = from_rp->p_caller_q;
+
+ /* preserve scheduling */
+ rp->p_scheduler = from_rp->p_scheduler;
+#ifdef CONFIG_SMP
+ rp->p_cpu = from_rp->p_cpu;
+ memcpy(rp->p_cpu_mask, from_rp->p_cpu_mask,
+ sizeof(bitchunk_t) * BITMAP_CHUNKS(CONFIG_MAX_CPUS));
+#endif
}
/*===========================================================================*