changeset 1f14f6f5e613 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=1f14f6f5e613
description:
X86: Handle 32 bit system call arguments.
diffstat:
1 file changed, 13 insertions(+), 2 deletions(-)
src/arch/x86/process.cc | 15 +++++++++++++--
diffs (42 lines):
diff -r 2d9737bf3c2f -r 1f14f6f5e613 src/arch/x86/process.cc
--- a/src/arch/x86/process.cc Fri Feb 27 09:22:14 2009 -0800
+++ b/src/arch/x86/process.cc Fri Feb 27 09:22:30 2009 -0800
@@ -116,6 +116,14 @@
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 @@
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 @@
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);
}
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev