summaryrefslogtreecommitdiff
path: root/src/arch/x86/process.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/arch/x86/process.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/arch/x86/process.hh')
-rw-r--r--src/arch/x86/process.hh47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh
index 9e3fafbdd..4240ee625 100644
--- a/src/arch/x86/process.hh
+++ b/src/arch/x86/process.hh
@@ -82,6 +82,21 @@ namespace X86ISA
SyscallDesc* getDesc(int callnum);
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
+ void clone(ThreadContext *old_tc, ThreadContext *new_tc,
+ Process *process, TheISA::IntReg flags);
+
+ X86Process &
+ operator=(const X86Process &in)
+ {
+ if (this == &in)
+ return *this;
+
+ _gdtStart = in._gdtStart;
+ _gdtSize = in._gdtSize;
+ syscallDescs = in.syscallDescs;
+
+ return *this;
+ }
};
class X86_64Process : public X86Process
@@ -97,6 +112,20 @@ namespace X86ISA
Addr size;
Addr vtimeOffset;
Addr vgettimeofdayOffset;
+
+ VSyscallPage &
+ operator=(const VSyscallPage &in)
+ {
+ if (this == &in)
+ return *this;
+
+ base = in.base;
+ size = in.size;
+ vtimeOffset = in.vtimeOffset;
+ vgettimeofdayOffset = in.vgettimeofdayOffset;
+
+ return *this;
+ }
};
VSyscallPage vsyscallPage;
@@ -108,6 +137,8 @@ namespace X86ISA
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
+ void clone(ThreadContext *old_tc, ThreadContext *new_tc,
+ Process *process, TheISA::IntReg flags);
};
class I386Process : public X86Process
@@ -123,6 +154,20 @@ namespace X86ISA
Addr size;
Addr vsyscallOffset;
Addr vsysexitOffset;
+
+ VSyscallPage &
+ operator=(const VSyscallPage &in)
+ {
+ if (this == &in)
+ return *this;
+
+ base = in.base;
+ size = in.size;
+ vsyscallOffset = in.vsyscallOffset;
+ vsysexitOffset = in.vsysexitOffset;
+
+ return *this;
+ }
};
VSyscallPage vsyscallPage;
@@ -134,6 +179,8 @@ namespace X86ISA
X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width);
void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
+ void clone(ThreadContext *old_tc, ThreadContext *new_tc,
+ Process *process, TheISA::IntReg flags);
};
/**