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_context.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/cpu/thread_context.hh') diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh index ecbd1a41e..bb6b54c08 100644 --- a/src/cpu/thread_context.hh +++ b/src/cpu/thread_context.hh @@ -161,6 +161,8 @@ class ThreadContext virtual Process *getProcessPtr() = 0; + virtual void setProcessPtr(Process *p) = 0; + virtual Status status() const = 0; virtual void setStatus(Status new_status) = 0; @@ -223,6 +225,14 @@ class ThreadContext virtual void pcState(const TheISA::PCState &val) = 0; + void + setNPC(Addr val) + { + TheISA::PCState pc_state = pcState(); + pc_state.setNPC(val); + pcState(pc_state); + } + virtual void pcStateNoRecord(const TheISA::PCState &val) = 0; virtual Addr instAddr() = 0; @@ -360,6 +370,8 @@ class ProxyThreadContext : public ThreadContext Process *getProcessPtr() { return actualTC->getProcessPtr(); } + void setProcessPtr(Process *p) { actualTC->setProcessPtr(p); } + Status status() const { return actualTC->status(); } void setStatus(Status new_status) { actualTC->setStatus(new_status); } -- cgit v1.2.3