utility.cc (7811:a8fc35183c10) | utility.cc (8466:9c754e3022b7) |
---|---|
1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company | 1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company |
3 * Copyright (c) 2011 Advanced Micro Devices, Inc. |
|
3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 26 unchanged lines hidden (view full) --- 37 * Authors: Gabe Black 38 */ 39 40#include "config/full_system.hh" 41 42#if FULL_SYSTEM 43#include "arch/x86/interrupts.hh" 44#endif | 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating 9 * to a hardware implementation of the functionality of the software 10 * licensed hereunder. You may use the software subject to the license 11 * terms below provided that you ensure that this notice is replicated --- 26 unchanged lines hidden (view full) --- 38 * Authors: Gabe Black 39 */ 40 41#include "config/full_system.hh" 42 43#if FULL_SYSTEM 44#include "arch/x86/interrupts.hh" 45#endif |
45#include "arch/x86/regs/int.hh" 46#include "arch/x86/regs/misc.hh" 47#include "arch/x86/regs/segment.hh" | 46#include "arch/x86/registers.hh" 47#include "arch/x86/tlb.hh" |
48#include "arch/x86/utility.hh" 49#include "arch/x86/x86_traits.hh" 50#include "cpu/base.hh" 51#include "sim/system.hh" 52 53namespace X86ISA { 54 55uint64_t --- 153 unchanged lines hidden (view full) --- 209#else 210 tc->activate(0); 211#endif 212} 213 214void 215copyMiscRegs(ThreadContext *src, ThreadContext *dest) 216{ | 48#include "arch/x86/utility.hh" 49#include "arch/x86/x86_traits.hh" 50#include "cpu/base.hh" 51#include "sim/system.hh" 52 53namespace X86ISA { 54 55uint64_t --- 153 unchanged lines hidden (view full) --- 209#else 210 tc->activate(0); 211#endif 212} 213 214void 215copyMiscRegs(ThreadContext *src, ThreadContext *dest) 216{ |
217 warn("copyMiscRegs is naively implemented for x86\n"); | 217 // This function assumes no side effects other than TLB invalidation 218 // need to be considered while copying state. That will likely not be 219 // true in the future. |
218 for (int i = 0; i < NUM_MISCREGS; ++i) { 219 if ( ( i != MISCREG_CR1 && 220 !(i > MISCREG_CR4 && i < MISCREG_CR8) && 221 !(i > MISCREG_CR8 && i <= MISCREG_CR15) ) == false) { 222 continue; 223 } 224 dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i)); 225 } | 220 for (int i = 0; i < NUM_MISCREGS; ++i) { 221 if ( ( i != MISCREG_CR1 && 222 !(i > MISCREG_CR4 && i < MISCREG_CR8) && 223 !(i > MISCREG_CR8 && i <= MISCREG_CR15) ) == false) { 224 continue; 225 } 226 dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i)); 227 } |
228 229 dest->getITBPtr()->invalidateAll(); 230 dest->getDTBPtr()->invalidateAll(); |
|
226} 227 228void 229copyRegs(ThreadContext *src, ThreadContext *dest) 230{ | 231} 232 233void 234copyRegs(ThreadContext *src, ThreadContext *dest) 235{ |
231 panic("copyRegs not implemented for x86!\n"); | |
232 //copy int regs | 236 //copy int regs |
237 for (int i = 0; i < NumIntRegs; ++i) 238 dest->setIntReg(i, src->readIntReg(i)); |
|
233 //copy float regs | 239 //copy float regs |
240 for (int i = 0; i < NumFloatRegs; ++i) 241 dest->setFloatRegBits(i, src->readFloatRegBits(i)); |
|
234 copyMiscRegs(src, dest); | 242 copyMiscRegs(src, dest); |
235 | |
236 dest->pcState(src->pcState()); 237} 238 239void 240skipFunction(ThreadContext *tc) 241{ 242 panic("Not implemented for x86\n"); 243} 244 245 246} // namespace X86_ISA | 243 dest->pcState(src->pcState()); 244} 245 246void 247skipFunction(ThreadContext *tc) 248{ 249 panic("Not implemented for x86\n"); 250} 251 252 253} // namespace X86_ISA |