112288Sgabeblack@google.com/* 212288Sgabeblack@google.com * Copyright (c) 2006-2007 The Regents of The University of Michigan 312288Sgabeblack@google.com * All rights reserved. 412288Sgabeblack@google.com * 512288Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without 612288Sgabeblack@google.com * modification, are permitted provided that the following conditions are 712288Sgabeblack@google.com * met: redistributions of source code must retain the above copyright 812288Sgabeblack@google.com * notice, this list of conditions and the following disclaimer; 912288Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright 1012288Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the 1112288Sgabeblack@google.com * documentation and/or other materials provided with the distribution; 1212288Sgabeblack@google.com * neither the name of the copyright holders nor the names of its 1312288Sgabeblack@google.com * contributors may be used to endorse or promote products derived from 1412288Sgabeblack@google.com * this software without specific prior written permission. 1512288Sgabeblack@google.com * 1612288Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1712288Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1812288Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1912288Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2012288Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2112288Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2212288Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2312288Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2412288Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2512288Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2612288Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2712288Sgabeblack@google.com * 2812288Sgabeblack@google.com * Authors: Gabe Black 2912288Sgabeblack@google.com * Steve Reinhardt 3012288Sgabeblack@google.com */ 3112288Sgabeblack@google.com 3212288Sgabeblack@google.com//////////////////////////////////////////////////////////////////// 3312288Sgabeblack@google.com// 3412288Sgabeblack@google.com// Trap instructions 3512288Sgabeblack@google.com// 3612288Sgabeblack@google.com 3712288Sgabeblack@google.com#ifndef __ARCH_SPARC_INSTS_TRAP_HH__ 3812288Sgabeblack@google.com#define __ARCH_SPARC_INSTS_TRAP_HH__ 3912288Sgabeblack@google.com 4012288Sgabeblack@google.com#include "arch/sparc/insts/static_inst.hh" 4112288Sgabeblack@google.com 4212288Sgabeblack@google.comnamespace SparcISA 4312288Sgabeblack@google.com{ 4412288Sgabeblack@google.com 4512288Sgabeblack@google.com/** 4612288Sgabeblack@google.com * Base class for trap instructions, 4712288Sgabeblack@google.com * or instructions that always fault. 4812288Sgabeblack@google.com */ 4912288Sgabeblack@google.comclass Trap : public SparcStaticInst 5012288Sgabeblack@google.com{ 5112288Sgabeblack@google.com protected: 5212288Sgabeblack@google.com 5312288Sgabeblack@google.com // Constructor 5412288Sgabeblack@google.com Trap(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : 5512288Sgabeblack@google.com SparcStaticInst(mnem, _machInst, __opClass), 5612288Sgabeblack@google.com trapNum(bits(_machInst, 7, 0)) 5712288Sgabeblack@google.com {} 5812288Sgabeblack@google.com 5912288Sgabeblack@google.com std::string generateDisassembly( 6012288Sgabeblack@google.com Addr pc, const SymbolTable *symtab) const override; 6112288Sgabeblack@google.com 6212288Sgabeblack@google.com int trapNum; 6312288Sgabeblack@google.com}; 6412288Sgabeblack@google.com 6512288Sgabeblack@google.comclass FpUnimpl : public SparcStaticInst 6612288Sgabeblack@google.com{ 6712288Sgabeblack@google.com protected: 6812288Sgabeblack@google.com using SparcStaticInst::SparcStaticInst; 6912288Sgabeblack@google.com 7012288Sgabeblack@google.com std::string 7112288Sgabeblack@google.com generateDisassembly(Addr pc, const SymbolTable *symtab) const override 7212288Sgabeblack@google.com { 7312288Sgabeblack@google.com return mnemonic; 7412288Sgabeblack@google.com } 7512288Sgabeblack@google.com}; 7612288Sgabeblack@google.com 7712288Sgabeblack@google.com} 7812288Sgabeblack@google.com 7912288Sgabeblack@google.com#endif // __ARCH_SPARC_INSTS_TRAP_HH__ 80