diff -r fad37c6670a6 -r d7efd5321811 src/arch/x86/utility.cc --- a/src/arch/x86/utility.cc Tue Jul 05 18:30:05 2011 -0700 +++ b/src/arch/x86/utility.cc Thu Jul 07 10:00:11 2011 -0500 @@ -42,9 +42,8 @@ #if FULL_SYSTEM #include "arch/x86/interrupts.hh" #endif -#include "arch/x86/regs/int.hh" -#include "arch/x86/regs/misc.hh" #include "arch/x86/regs/segment.hh" +#include "arch/x86/registers.hh" #include "arch/x86/utility.hh" #include "arch/x86/x86_traits.hh" #include "cpu/base.hh" @@ -214,7 +213,8 @@ void copyMiscRegs(ThreadContext *src, ThreadContext *dest) { - warn("copyMiscRegs is naively implemented for x86\n"); + // This function assumes that the registers are consistent amongst + // themselves. Hence, no side effects need to be taken care of. for (int i = 0; i < NUM_MISCREGS; ++i) { if ( ( i != MISCREG_CR1 && !(i > MISCREG_CR4 && i < MISCREG_CR8) && @@ -223,16 +223,21 @@ } dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i)); } + + dest->getITBPtr()->invalidateAll(); + dest->getDTBPtr()->invalidateAll(); } void copyRegs(ThreadContext *src, ThreadContext *dest) { - panic("copyRegs not implemented for x86!\n"); //copy int regs + for (int i = 0; i < NumIntRegs; ++i) + dest->setIntReg(i, src->readIntReg(i)); //copy float regs + for (int i = 0; i < NumFloatRegs; ++i) + dest->setFloatRegBits(i, src->readFloatRegBits(i)); copyMiscRegs(src, dest); - dest->pcState(src->pcState()); }