1/* 2 * Copyright (c) 2006-2007 The Regents of The University of Michigan 3 * All rights reserved 4 * Copyright 2017 Google Inc. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 32 unchanged lines hidden (view full) --- 41 42/** 43 * Base class for privelege mode operations. 44 */ 45class Priv : public SparcStaticInst 46{ 47 protected: 48 using SparcStaticInst::SparcStaticInst; |
49 std::string generateDisassembly( 50 Addr pc, const SymbolTable *symtab) const override; |
51}; 52 53class PrivReg : public Priv 54{ 55 protected: 56 PrivReg(const char *mnem, ExtMachInst _machInst, 57 OpClass __opClass, char const * _regName) : 58 Priv(mnem, _machInst, __opClass), regName(_regName) 59 {} 60 61 char const *regName; 62}; 63 64// This class is for instructions that explicitly read control 65// registers. It provides a special generateDisassembly function. 66class RdPriv : public PrivReg 67{ 68 protected: 69 using PrivReg::PrivReg; |
70 std::string generateDisassembly( 71 Addr pc, const SymbolTable *symtab) const override; |
72}; 73 74// This class is for instructions that explicitly write control 75// registers. It provides a special generateDisassembly function. 76class WrPriv : public PrivReg 77{ 78 protected: 79 using PrivReg::PrivReg; |
80 std::string generateDisassembly( 81 Addr pc, const SymbolTable *symtab) const override; |
82}; 83 84/** 85 * Base class for privelege mode operations with immediates. 86 */ 87class PrivImm : public Priv 88{ 89 protected: --- 11 unchanged lines hidden (view full) --- 101{ 102 protected: 103 // Constructor 104 WrPrivImm(const char *mnem, ExtMachInst _machInst, 105 OpClass __opClass, char const *_regName) : 106 PrivImm(mnem, _machInst, __opClass), regName(_regName) 107 {} 108 |
109 std::string generateDisassembly( 110 Addr pc, const SymbolTable *symtab) const override; |
111 112 char const *regName; |
113}; 114 |
115} |
116 117#endif //__ARCH_SPARC_INSTS_PRIV_HH__ |