arguments.cc revision 7693
110260SAndrew.Bardsley@arm.com/* 210260SAndrew.Bardsley@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 310260SAndrew.Bardsley@arm.com * All rights reserved. 410260SAndrew.Bardsley@arm.com * 510260SAndrew.Bardsley@arm.com * Redistribution and use in source and binary forms, with or without 610260SAndrew.Bardsley@arm.com * modification, are permitted provided that the following conditions are 710260SAndrew.Bardsley@arm.com * met: redistributions of source code must retain the above copyright 810260SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer; 910260SAndrew.Bardsley@arm.com * redistributions in binary form must reproduce the above copyright 1010260SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer in the 1110260SAndrew.Bardsley@arm.com * documentation and/or other materials provided with the distribution; 1210260SAndrew.Bardsley@arm.com * neither the name of the copyright holders nor the names of its 1310315Snilay@cs.wisc.edu * contributors may be used to endorse or promote products derived from 1410260SAndrew.Bardsley@arm.com * this software without specific prior written permission. 1510260SAndrew.Bardsley@arm.com * 1610260SAndrew.Bardsley@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1711570SCurtis.Dunham@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1810260SAndrew.Bardsley@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1911570SCurtis.Dunham@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2010260SAndrew.Bardsley@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2110260SAndrew.Bardsley@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2210315Snilay@cs.wisc.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2310260SAndrew.Bardsley@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2410260SAndrew.Bardsley@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2510260SAndrew.Bardsley@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2610260SAndrew.Bardsley@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2710260SAndrew.Bardsley@arm.com * 2810753Sstever@gmail.com * Authors: Nathan Binkert 2911570SCurtis.Dunham@arm.com */ 3010260SAndrew.Bardsley@arm.com 3111570SCurtis.Dunham@arm.com#include "arch/utility.hh" 3211570SCurtis.Dunham@arm.com#include "config/the_isa.hh" 3311570SCurtis.Dunham@arm.com#include "cpu/thread_context.hh" 3411570SCurtis.Dunham@arm.com#include "sim/arguments.hh" 3510260SAndrew.Bardsley@arm.com 3610260SAndrew.Bardsley@arm.comArguments::Data::~Data() 3711570SCurtis.Dunham@arm.com{ 3811570SCurtis.Dunham@arm.com while (!data.empty()) { 3910260SAndrew.Bardsley@arm.com delete [] data.front(); 4010260SAndrew.Bardsley@arm.com data.pop_front(); 4110260SAndrew.Bardsley@arm.com } 4210260SAndrew.Bardsley@arm.com} 4310260SAndrew.Bardsley@arm.com 4410260SAndrew.Bardsley@arm.comchar * 4510260SAndrew.Bardsley@arm.comArguments::Data::alloc(size_t size) 4610260SAndrew.Bardsley@arm.com{ 4710260SAndrew.Bardsley@arm.com char *buf = new char[size]; 4810260SAndrew.Bardsley@arm.com data.push_back(buf); 4910260SAndrew.Bardsley@arm.com return buf; 5010260SAndrew.Bardsley@arm.com} 5110315Snilay@cs.wisc.edu 5210260SAndrew.Bardsley@arm.comuint64_t 5310315Snilay@cs.wisc.eduArguments::getArg(uint8_t size, bool fp) 5410260SAndrew.Bardsley@arm.com{ 5510260SAndrew.Bardsley@arm.com return TheISA::getArgument(tc, number, size, fp); 5610260SAndrew.Bardsley@arm.com} 5710260SAndrew.Bardsley@arm.com 5810260SAndrew.Bardsley@arm.com