summaryrefslogtreecommitdiff
path: root/src/arch/x86/regfile.cc
diff options
context:
space:
mode:
authorDaniel Sanchez <sanchezd@stanford.edu>2009-04-21 08:17:36 -0700
committerDaniel Sanchez <sanchezd@stanford.edu>2009-04-21 08:17:36 -0700
commitb0e9654f8621729400ba627ed8c9bd0bf3833f7a (patch)
tree9d2131b1d6cfd177878b06595735627da7797527 /src/arch/x86/regfile.cc
parentb0489d18ed74b542e311a2a7238cd5e19bd4b2ab (diff)
downloadgem5-b0e9654f8621729400ba627ed8c9bd0bf3833f7a.tar.xz
Commit m5threads package.
This patch adds limited multithreading support in syscall-emulation mode, by using the clone system call. The clone system call works for Alpha, SPARC and x86, and multithreaded applications run correctly in Alpha and SPARC.
Diffstat (limited to 'src/arch/x86/regfile.cc')
-rw-r--r--src/arch/x86/regfile.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/arch/x86/regfile.cc b/src/arch/x86/regfile.cc
index 7d01c4bb4..83279902e 100644
--- a/src/arch/x86/regfile.cc
+++ b/src/arch/x86/regfile.cc
@@ -250,7 +250,17 @@ RegFile::unserialize(EventManager *em, Checkpoint *cp, const string &section)
void X86ISA::copyMiscRegs(ThreadContext *src, ThreadContext *dest)
{
- panic("copyMiscRegs not implemented for x86!\n");
+ //panic("copyMiscRegs not implemented for x86!\n");
+ warn("copyMiscRegs is naively implemented for x86\n");
+ for (int i = 0; i < X86ISA::NumMiscRegs; ++i) {
+ if ( ( i != MISCREG_CR1 &&
+ !(i > MISCREG_CR4 && i < MISCREG_CR8) &&
+ !(i > MISCREG_CR8 && i <= MISCREG_CR15) ) == false) {
+ continue;
+ }
+ dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i));
+ }
+
}
void X86ISA::copyRegs(ThreadContext *src, ThreadContext *dest)