utility.cc revision 8787
15390SN/A/* 25445SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan 35390SN/A * Copyright (c) 2007-2008 The Florida State University 45390SN/A * Copyright (c) 2009 The University of Edinburgh 55390SN/A * All rights reserved. 65390SN/A * 75390SN/A * Redistribution and use in source and binary forms, with or without 85390SN/A * modification, are permitted provided that the following conditions are 95390SN/A * met: redistributions of source code must retain the above copyright 105390SN/A * notice, this list of conditions and the following disclaimer; 115390SN/A * redistributions in binary form must reproduce the above copyright 125390SN/A * notice, this list of conditions and the following disclaimer in the 135390SN/A * documentation and/or other materials provided with the distribution; 145390SN/A * neither the name of the copyright holders nor the names of its 155390SN/A * contributors may be used to endorse or promote products derived from 165390SN/A * this software without specific prior written permission. 175390SN/A * 185390SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 195390SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 205390SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 215390SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 225390SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 235390SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 245390SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 255390SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 265390SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 275390SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 285390SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 295390SN/A * 305390SN/A * Authors: Korey Sewell 3111793Sbrandon.potter@amd.com * Stephen Hines 3211793Sbrandon.potter@amd.com * Timothy M. Jones 335390SN/A */ 345445SN/A 358232Snate@binkert.org#include "arch/power/utility.hh" 365636Sgblack@eecs.umich.edu#include "base/misc.hh" 375636Sgblack@eecs.umich.edu 385390SN/Anamespace PowerISA { 395390SN/A 405390SN/Avoid 415390SN/AcopyRegs(ThreadContext *src, ThreadContext *dest) 425390SN/A{ 435636Sgblack@eecs.umich.edu // First loop through the integer registers. 445390SN/A for (int i = 0; i < NumIntRegs; ++i) 455636Sgblack@eecs.umich.edu dest->setIntReg(i, src->readIntReg(i)); 465636Sgblack@eecs.umich.edu 475445SN/A // Then loop through the floating point registers. 485445SN/A for (int i = 0; i < NumFloatRegs; ++i) 495445SN/A dest->setFloatRegBits(i, src->readFloatRegBits(i)); 505445SN/A 5113229Sgabeblack@google.com // Copy misc. registers 525898Sgblack@eecs.umich.edu copyMiscRegs(src, dest); 535390SN/A 545390SN/A // Lastly copy PC/NPC 555390SN/A dest->pcState(src->pcState()); 565390SN/A} 575390SN/A 585390SN/Auint64_t 595636Sgblack@eecs.umich.edugetArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) 605390SN/A{ 6113229Sgabeblack@google.com panic("getArgument not implemented for POWER.\n"); 625445SN/A return 0; 635445SN/A} 645445SN/A 655445SN/Avoid 665445SN/AskipFunction(ThreadContext *tc) 675445SN/A{ 685445SN/A panic("Not Implemented for POWER"); 695445SN/A} 705445SN/A 715636Sgblack@eecs.umich.edu 725445SN/A} // namespace PowerISA 735898Sgblack@eecs.umich.edu