summaryrefslogtreecommitdiff
path: root/src/cpu/thread_context.hh
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2017-02-27 14:10:15 -0500
committerBrandon Potter <brandon.potter@amd.com>2017-02-27 14:10:15 -0500
commit2367198921765848a4f5b3d020a7cc5776209f80 (patch)
tree00cff9357d9e5f2bec277cf937e8a73944ce1c98 /src/cpu/thread_context.hh
parent073cb266079edddec64ea8cd5169dd2cbef8f812 (diff)
downloadgem5-2367198921765848a4f5b3d020a7cc5776209f80.tar.xz
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.
Diffstat (limited to 'src/cpu/thread_context.hh')
-rw-r--r--src/cpu/thread_context.hh12
1 files changed, 12 insertions, 0 deletions
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); }