Deleted Added
sdiff udiff text old ( 11303:f694764d656d ) new ( 12234:78ece221f9f5 )
full compact
1// Copyright (c) AMD
2// All rights reserved.
3//
4// Authors: Marc Orr
5
6// Monitor Instruction
7
8output header {{

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

42 exec_output = BasicExecute.subst(iop)
43}};
44
45
46// Mwait instruction
47
48// Declarations for execute() methods.
49def template MwaitExecDeclare {{
50 Fault execute(%(CPU_exec_context)s *, Trace::InstRecord *) const;
51 Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
52 Fault completeAcc(PacketPtr, %(CPU_exec_context)s *,
53 Trace::InstRecord *) const;
54}};
55
56def template MwaitDeclare {{
57 class %(class_name)s : public %(base_class)s
58 {
59 public:
60 // Constructor.
61 %(class_name)s(ExtMachInst machInst);
62 %(MwaitExecDeclare)s
63 };
64}};
65
66def template MwaitInitiateAcc {{
67 Fault %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT * xc,
68 Trace::InstRecord * traceData) const
69 {
70 unsigned s = 0x8; //size
71 unsigned f = 0; //flags
72 initiateMemRead(xc, traceData, xc->getAddrMonitor()->vAddr, s, f);
73 return NoFault;
74 }
75}};
76
77def template MwaitCompleteAcc {{
78 Fault %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT *xc,
79 Trace::InstRecord *traceData) const
80 {
81 MicroHalt hltObj(machInst, mnemonic, 0x0);
82 if(xc->mwait(pkt)) {
83 hltObj.execute(xc, traceData);
84 }
85 return NoFault;
86 }

--- 44 unchanged lines hidden ---