priv.isa (2632:1bb2f91485ea) | priv.isa (2646:c5f20661d9f3) |
---|---|
1// Copyright (c) 2006 The Regents of The University of Michigan 2// All rights reserved. 3// 4// Redistribution and use in source and binary forms, with or without 5// modification, are permitted provided that the following conditions are 6// met: redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer; 8// redistributions in binary form must reproduce the above copyright --- 37 unchanged lines hidden (view full) --- 46 { 47 } 48 49 std::string generateDisassembly(Addr pc, 50 const SymbolTable *symtab) const; 51 }; 52 53 /** | 1// Copyright (c) 2006 The Regents of The University of Michigan 2// All rights reserved. 3// 4// Redistribution and use in source and binary forms, with or without 5// modification, are permitted provided that the following conditions are 6// met: redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer; 8// redistributions in binary form must reproduce the above copyright --- 37 unchanged lines hidden (view full) --- 46 { 47 } 48 49 std::string generateDisassembly(Addr pc, 50 const SymbolTable *symtab) const; 51 }; 52 53 /** |
54 * Base class for user mode "tick" access. 55 */ 56 class PrivTick : public SparcStaticInst 57 { 58 protected: 59 // Constructor 60 PrivTick(const char *mnem, ExtMachInst _machInst, 61 OpClass __opClass) : 62 SparcStaticInst(mnem, _machInst, __opClass) 63 { 64 } 65 66 std::string generateDisassembly(Addr pc, 67 const SymbolTable *symtab) const; 68 }; 69 70 /** | |
71 * Base class for privelege mode operations with immediates. 72 */ 73 class PrivImm : public Priv 74 { 75 protected: 76 // Constructor 77 PrivImm(const char *mnem, ExtMachInst _machInst, 78 OpClass __opClass) : 79 Priv(mnem, _machInst, __opClass), imm(SIMM13) 80 { 81 } 82 83 int32_t imm; 84 }; 85 | 54 * Base class for privelege mode operations with immediates. 55 */ 56 class PrivImm : public Priv 57 { 58 protected: 59 // Constructor 60 PrivImm(const char *mnem, ExtMachInst _machInst, 61 OpClass __opClass) : 62 Priv(mnem, _machInst, __opClass), imm(SIMM13) 63 { 64 } 65 66 int32_t imm; 67 }; 68 |
86 /** 87 * Base class for user mode "tick" access with immediates. 88 */ 89 class PrivTickImm : public PrivTick 90 { 91 protected: 92 // Constructor 93 PrivTickImm(const char *mnem, ExtMachInst _machInst, 94 OpClass __opClass) : 95 PrivTick(mnem, _machInst, __opClass), imm(SIMM13) 96 { 97 } 98 99 int32_t imm; 100 }; | |
101}}; 102 103output decoder {{ 104 std::string Priv::generateDisassembly(Addr pc, 105 const SymbolTable *symtab) const 106 { 107 return "Privileged Instruction"; 108 } | 69}}; 70 71output decoder {{ 72 std::string Priv::generateDisassembly(Addr pc, 73 const SymbolTable *symtab) const 74 { 75 return "Privileged Instruction"; 76 } |
109 110 std::string PrivTick::generateDisassembly(Addr pc, 111 const SymbolTable *symtab) const 112 { 113 return "Regular access to Tick"; 114 } | |
115}}; 116 117def template PrivExecute {{ 118 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, 119 Trace::InstRecord *traceData) const 120 { 121 %(op_decl)s; 122 %(op_rd)s; --- 26 unchanged lines hidden (view full) --- 149 decode_block = ROrImmDecode.subst(iop) 150 else: 151 decode_block = BasicDecode.subst(iop) 152 return (header_output, decoder_output, exec_output, decode_block) 153}}; 154 155// Primary format for integer operate instructions: 156def format Priv(code, *opt_flags) {{ | 77}}; 78 79def template PrivExecute {{ 80 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, 81 Trace::InstRecord *traceData) const 82 { 83 %(op_decl)s; 84 %(op_rd)s; --- 26 unchanged lines hidden (view full) --- 111 decode_block = ROrImmDecode.subst(iop) 112 else: 113 decode_block = BasicDecode.subst(iop) 114 return (header_output, decoder_output, exec_output, decode_block) 115}}; 116 117// Primary format for integer operate instructions: 118def format Priv(code, *opt_flags) {{ |
157 checkCode = "(!PstatePriv)" | 119 checkCode = "((xc->readMiscReg(PrStart + MISCREG_PSTATE))<2:2>)" |
158 (header_output, decoder_output, 159 exec_output, decode_block) = doPrivFormat(code, 160 checkCode, name, Name, opt_flags) 161}}; 162 | 120 (header_output, decoder_output, 121 exec_output, decode_block) = doPrivFormat(code, 122 checkCode, name, Name, opt_flags) 123}}; 124 |
163// Primary format for integer operate instructions: 164def format PrivTick(code, *opt_flags) {{ 165 checkCode = "(!PstatePriv && TickNpt)" 166 (header_output, decoder_output, 167 exec_output, decode_block) = doPrivFormat(code, 168 checkCode, name, Name, opt_flags) 169}}; | 125 |