summaryrefslogtreecommitdiff
path: root/src/arch/x86/process.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/process.hh')
-rw-r--r--src/arch/x86/process.hh72
1 files changed, 55 insertions, 17 deletions
diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh
index 5def9e13d..cd6d99e66 100644
--- a/src/arch/x86/process.hh
+++ b/src/arch/x86/process.hh
@@ -62,38 +62,76 @@
#include <vector>
#include "sim/process.hh"
+class SyscallDesc;
+
namespace X86ISA
{
- struct M5_64_auxv_t
+
+ class X86LiveProcess : public LiveProcess
{
- int64_t a_type;
- union {
- int64_t a_val;
- int64_t a_ptr;
- int64_t a_fcn;
- };
+ protected:
+ Addr _gdtStart;
+ Addr _gdtSize;
+
+ SyscallDesc *syscallDescs;
+ const int numSyscallDescs;
- M5_64_auxv_t()
- {}
+ X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
- M5_64_auxv_t(int64_t type, int64_t val);
+ template<class IntType>
+ void argsInit(int pageSize,
+ std::vector<AuxVector<IntType> > extraAuxvs);
+
+ public:
+ Addr gdtStart()
+ { return _gdtStart; }
+
+ Addr gdtSize()
+ { return _gdtSize; }
+
+ SyscallDesc* getDesc(int callnum);
+
+ void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
- class X86LiveProcess : public LiveProcess
+ class X86_64LiveProcess : public X86LiveProcess
{
protected:
- std::vector<M5_64_auxv_t> auxv;
-
- X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile);
+ X86_64LiveProcess(LiveProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
+ public:
+ void argsInit(int intSize, int pageSize);
void startup();
- public:
+ X86ISA::IntReg getSyscallArg(ThreadContext *tc, int i);
+ void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
+ };
- //Handles traps which request services from the operating system
- virtual void handleTrap(int trapNum, ThreadContext *tc);
+ class I386LiveProcess : public X86LiveProcess
+ {
+ protected:
+ I386LiveProcess(LiveProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
+ class VSyscallPage
+ {
+ public:
+ Addr base;
+ Addr size;
+ Addr vsyscallOffset;
+ Addr vsysexitOffset;
+ };
+ VSyscallPage vsyscallPage;
+
+ public:
void argsInit(int intSize, int pageSize);
+ void startup();
+
+ void syscall(int64_t callnum, ThreadContext *tc);
+ X86ISA::IntReg getSyscallArg(ThreadContext *tc, int i);
+ void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
};
}