diff options
author | Gabe Black <gabeblack@google.com> | 2020-01-12 22:58:48 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2020-01-23 23:38:25 +0000 |
commit | 46fbd76595faea874773a2ecbbdb36c3b56e697e (patch) | |
tree | 2ba267daa02c23ded8168cbeb68c0a76febca3c0 /src/sim/syscall_emul.hh | |
parent | e3c3d2a1a8aed9f67338ee08d678263525ffaddc (diff) | |
download | gem5-46fbd76595faea874773a2ecbbdb36c3b56e697e.tar.xz |
sim: Move findFreeContext to System.
This method searches through the ThreadContexts stored in the system,
and has no concrete connection to Process other than it happened to be
used by a Process in the clone system call.
By moving it, we can use its functionality in classes other than
Process.
Change-Id: Ic6899c335dc13841c6fe948ea3a4f8ad67e562bb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24285
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r-- | src/sim/syscall_emul.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index f7d87d445..62020397f 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1527,7 +1527,7 @@ cloneFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) return -EINVAL; ThreadContext *ctc; - if (!(ctc = p->findFreeContext())) { + if (!(ctc = tc->getSystemPtr()->findFreeContext())) { DPRINTF_SYSCALL(Verbose, "clone: no spare thread context in system" "[cpu %d, thread %d]", tc->cpuId(), tc->threadId()); return -EAGAIN; |