Deleted Added
sdiff udiff text old ( 3587:841cf134f321 ) new ( 3599:fd83707783c7 )
full compact
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

--- 36 unchanged lines hidden (view full) ---

45 SparcStaticInst(mnem, _machInst, __opClass)
46 {
47 }
48
49 std::string generateDisassembly(Addr pc,
50 const SymbolTable *symtab) const;
51 };
52
53 /**
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
69}};
70
71output decoder {{
72 std::string Priv::generateDisassembly(Addr pc,
73 const SymbolTable *symtab) const
74 {
75 std::stringstream response;
76
77 printMnemonic(response, mnemonic);
78
79 return response.str();
80 }
81}};
82
83def template PrivExecute {{
84 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
85 Trace::InstRecord *traceData) const
86 {
87 %(op_decl)s;
88 %(op_rd)s;
89
90 //If the processor isn't in privileged mode, fault out right away

--- 6 unchanged lines hidden (view full) ---

97 return fault;
98 }
99}};
100
101let {{
102 def doPrivFormat(code, checkCode, name, Name, opt_flags):
103 (usesImm, code, immCode,
104 rString, iString) = splitOutImm(code)
105 iop = InstObjParams(name, Name, 'Priv', code,
106 opt_flags, {"check": checkCode})
107 header_output = BasicDeclare.subst(iop)
108 decoder_output = BasicConstructor.subst(iop)
109 exec_output = PrivExecute.subst(iop)
110 if usesImm:
111 imm_iop = InstObjParams(name, Name + 'Imm', 'PrivImm',
112 immCode, opt_flags, {"check": checkCode})
113 header_output += BasicDeclare.subst(imm_iop)
114 decoder_output += BasicConstructor.subst(imm_iop)
115 exec_output += PrivExecute.subst(imm_iop)
116 decode_block = ROrImmDecode.subst(iop)
117 else:
118 decode_block = BasicDecode.subst(iop)
119 return (header_output, decoder_output, exec_output, decode_block)
120}};
121
122def format Priv(code, *opt_flags) {{

--- 30 unchanged lines hidden ---