summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-02-27 09:22:30 -0800
committerGabe Black <gblack@eecs.umich.edu>2009-02-27 09:22:30 -0800
commit6ca53f8675ec0cc31de09d0878b4c29d4048a1fa (patch)
treec5d9cef658f59e5d3acea42246bb758f9224d357 /src
parent9a000c51736d97c1109be296ea7d1fd41d84debb (diff)
downloadgem5-6ca53f8675ec0cc31de09d0878b4c29d4048a1fa.tar.xz
X86: Handle 32 bit system call arguments.
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/process.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index 7d7978a35..232f07934 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -116,6 +116,14 @@ static const int ArgumentReg[] = {
INTREG_R9W
};
static const int NumArgumentRegs = sizeof(ArgumentReg) / sizeof(const int);
+static const int ArgumentReg32[] = {
+ INTREG_EBX,
+ INTREG_ECX,
+ INTREG_EDX,
+ INTREG_ESI,
+ INTREG_EDI,
+};
+static const int NumArgumentRegs32 = sizeof(ArgumentReg) / sizeof(const int);
X86LiveProcess::X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile,
SyscallDesc *_syscallDescs, int _numSyscallDescs) :
@@ -260,6 +268,7 @@ I386LiveProcess::startup()
tc->setMiscRegNoEffect(MISCREG_SEG_EFF_BASE(seg), 0);
tc->setMiscRegNoEffect(MISCREG_SEG_ATTR(seg), dataAttr);
tc->setMiscRegNoEffect(MISCREG_SEG_SEL(seg), 0xB);
+ tc->setMiscRegNoEffect(MISCREG_SEG_LIMIT(seg), (uint32_t)(-1));
}
SegAttr csAttr = 0;
@@ -610,11 +619,13 @@ X86_64LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
X86ISA::IntReg
I386LiveProcess::getSyscallArg(ThreadContext *tc, int i)
{
- panic("32 bit getSyscallArg not implemented.\n");
+ assert(i < NumArgumentRegs32);
+ return tc->readIntReg(ArgumentReg32[i]);
}
void
I386LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
{
- panic("32 bit setSyscallArg not implemented.\n");
+ assert(i < NumArgumentRegs);
+ return tc->setIntReg(ArgumentReg[i], val);
}