utility.cc revision 7811
12810SN/A/* 29725Sandreas.hansson@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 39347SAndreas.Sandberg@arm.com * Copyright (c) 2007-2008 The Florida State University 49347SAndreas.Sandberg@arm.com * Copyright (c) 2009 The University of Edinburgh 59347SAndreas.Sandberg@arm.com * All rights reserved. 69347SAndreas.Sandberg@arm.com * 79347SAndreas.Sandberg@arm.com * Redistribution and use in source and binary forms, with or without 89347SAndreas.Sandberg@arm.com * modification, are permitted provided that the following conditions are 99347SAndreas.Sandberg@arm.com * met: redistributions of source code must retain the above copyright 109347SAndreas.Sandberg@arm.com * notice, this list of conditions and the following disclaimer; 119347SAndreas.Sandberg@arm.com * redistributions in binary form must reproduce the above copyright 129347SAndreas.Sandberg@arm.com * notice, this list of conditions and the following disclaimer in the 139347SAndreas.Sandberg@arm.com * documentation and/or other materials provided with the distribution; 142810SN/A * neither the name of the copyright holders nor the names of its 152810SN/A * contributors may be used to endorse or promote products derived from 162810SN/A * this software without specific prior written permission. 172810SN/A * 182810SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 192810SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 202810SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 212810SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 222810SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 232810SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 242810SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 252810SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 262810SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 272810SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 282810SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 292810SN/A * 302810SN/A * Authors: Korey Sewell 312810SN/A * Stephen Hines 322810SN/A * Timothy M. Jones 332810SN/A */ 342810SN/A 352810SN/A#include "arch/power/utility.hh" 362810SN/A#include "base/misc.hh" 372810SN/A 382810SN/Anamespace PowerISA { 392810SN/A 402810SN/Avoid 419347SAndreas.Sandberg@arm.comcopyRegs(ThreadContext *src, ThreadContext *dest) 422810SN/A{ 432810SN/A // First loop through the integer registers. 442810SN/A for (int i = 0; i < NumIntRegs; ++i) 454626SN/A dest->setIntReg(i, src->readIntReg(i)); 462810SN/A 472810SN/A // Then loop through the floating point registers. 4810509SAli.Saidi@ARM.com for (int i = 0; i < NumFloatRegs; ++i) 495338Sstever@gmail.com dest->setFloatRegBits(i, src->readFloatRegBits(i)); 5010509SAli.Saidi@ARM.com 512810SN/A // Copy misc. registers 522810SN/A copyMiscRegs(src, dest); 532810SN/A 545314SN/A // Lastly copy PC/NPC 5510622Smitch.hayenga@arm.com dest->pcState(src->pcState()); 5610622Smitch.hayenga@arm.com} 579725Sandreas.hansson@arm.com 5810622Smitch.hayenga@arm.comvoid 5910622Smitch.hayenga@arm.comskipFunction(ThreadContext *tc) 6010622Smitch.hayenga@arm.com{ 612810SN/A panic("Not Implemented for POWER"); 624626SN/A} 634626SN/A 642810SN/A 652810SN/A} // namespace PowerISA 662810SN/A