uti: Identify uti thread by clone count

--uti-thread-count <count> is added to mcexec.

Change-Id: Id9ec464412a5bb71e4d9e87d05f79de22d35b067
This commit is contained in:
Masamichi Takagi
2018-09-04 10:27:52 +09:00
parent b0d7f890d0
commit b6ab5911b7
7 changed files with 36 additions and 2 deletions

View File

@ -2451,6 +2451,18 @@ unsigned long do_fork(int clone_flags, unsigned long newsp,
return -EAGAIN;
}
/* N-th creation put the new on Linux CPU. It's turned off when zero is
set to uti_thread_rank. */
if (oldproc->uti_thread_rank) {
if (oldproc->clone_count + 1 == oldproc->uti_thread_rank) {
old->mod_clone = SPAWN_TO_REMOTE;
kprintf("%s: mod_clone is set to %d\n", __FUNCTION__, old->mod_clone);
} else {
old->mod_clone = SPAWN_TO_LOCAL;
kprintf("%s: mod_clone is set to %d\n", __FUNCTION__, old->mod_clone);
}
}
new = clone_thread(old, curpc,
newsp ? newsp : cursp, clone_flags);