From 2367198921765848a4f5b3d020a7cc5776209f80 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Mon, 27 Feb 2017 14:10:15 -0500 Subject: syscall_emul: [PATCH 15/22] add clone/execve for threading and multiprocess simulations Modifies the clone system call and adds execve system call. Requires allowing processes to steal thread contexts from other processes in the same system object and the ability to detach pieces of process state (such as MemState) to allow dynamic sharing. --- src/cpu/thread_state.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/cpu/thread_state.hh') diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh index 3a35d444a..5cbc3322b 100644 --- a/src/cpu/thread_state.hh +++ b/src/cpu/thread_state.hh @@ -107,6 +107,21 @@ struct ThreadState : public Serializable { Process *getProcessPtr() { return process; } + void setProcessPtr(Process *p) + { + process = p; + /** + * When the process pointer changes while operating in SE Mode, + * the se translating port proxy needs to be reinitialized since it + * holds a pointer to the process class. + */ + if (proxy) { + delete proxy; + proxy = NULL; + initMemProxies(NULL); + } + } + SETranslatingPortProxy &getMemProxy(); /** Reads the number of instructions functionally executed and -- cgit v1.2.3