blob: 4b3a02fca4c1e96800c8c3406020bff21bfea2cb [file] [log] [blame]
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -05001/*
Rekai Gonzalez-Alberquilla00da0892017-04-05 13:24:00 -05002 * Copyright (c) 2011-2014, 2016 ARM Limited
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -05003 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license
11 * terms below provided that you ensure that this notice is replicated
12 * unmodified and in its entirety in all distributions of the software,
13 * modified or unmodified, in source code or in binary form.
14 *
15 * Copyright (c) 2002-2005 The Regents of The University of Michigan
16 * All rights reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are
20 * met: redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer;
22 * redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution;
25 * neither the name of the copyright holders nor the names of its
26 * contributors may be used to endorse or promote products derived from
27 * this software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * Authors: Steve Reinhardt
42 * Dave Greene
43 * Nathan Binkert
44 * Andrew Bardsley
45 */
46
47/**
48 * @file
49 *
50 * ExecContext bears the exec_context interface for Minor.
51 */
52
53#ifndef __CPU_MINOR_EXEC_CONTEXT_HH__
54#define __CPU_MINOR_EXEC_CONTEXT_HH__
55
Andreas Sandberg326662b2014-09-03 07:42:22 -040056#include "cpu/exec_context.hh"
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -050057#include "cpu/minor/execute.hh"
58#include "cpu/minor/pipeline.hh"
59#include "cpu/base.hh"
60#include "cpu/simple_thread.hh"
Nikos Nikoleris698767e2016-08-15 12:00:35 +010061#include "mem/request.hh"
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -050062#include "debug/MinorExecute.hh"
63
64namespace Minor
65{
66
67/* Forward declaration of Execute */
68class Execute;
69
70/** ExecContext bears the exec_context interface for Minor. This nicely
71 * separates that interface from other classes such as Pipeline, MinorCPU
72 * and DynMinorInst and makes it easier to see what state is accessed by it.
73 */
Andreas Sandberg326662b2014-09-03 07:42:22 -040074class ExecContext : public ::ExecContext
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -050075{
76 public:
77 MinorCPU &cpu;
78
79 /** ThreadState object, provides all the architectural state. */
80 SimpleThread &thread;
81
82 /** The execute stage so we can peek at its contents. */
83 Execute &execute;
84
85 /** Instruction for the benefit of memory operations and for PC */
86 MinorDynInstPtr inst;
87
88 ExecContext (
89 MinorCPU &cpu_,
90 SimpleThread &thread_, Execute &execute_,
91 MinorDynInstPtr inst_) :
92 cpu(cpu_),
93 thread(thread_),
94 execute(execute_),
95 inst(inst_)
96 {
97 DPRINTF(MinorExecute, "ExecContext setting PC: %s\n", inst->pc);
98 pcState(inst->pc);
99 setPredicate(true);
100 thread.setIntReg(TheISA::ZeroReg, 0);
101#if THE_ISA == ALPHA_ISA
102 thread.setFloatReg(TheISA::ZeroReg, 0.0);
103#endif
104 }
105
106 Fault
Andreas Sandberg2c05f522016-08-15 12:00:37 +0100107 initiateMemRead(Addr addr, unsigned int size,
108 Request::Flags flags) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500109 {
Steve Reinhardt1b6355c2016-01-17 18:27:46 -0800110 execute.getLSQ().pushRequest(inst, true /* load */, nullptr,
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500111 size, addr, flags, NULL);
112 return NoFault;
113 }
114
115 Fault
116 writeMem(uint8_t *data, unsigned int size, Addr addr,
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100117 Request::Flags flags, uint64_t *res) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500118 {
119 execute.getLSQ().pushRequest(inst, false /* store */, data,
120 size, addr, flags, res);
121 return NoFault;
122 }
123
Andreas Sandberg326662b2014-09-03 07:42:22 -0400124 IntReg
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100125 readIntRegOperand(const StaticInst *si, int idx) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500126 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500127 const RegId& reg = si->srcRegIdx(idx);
128 assert(reg.isIntReg());
129 return thread.readIntReg(reg.index());
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500130 }
131
132 TheISA::FloatReg
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100133 readFloatRegOperand(const StaticInst *si, int idx) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500134 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500135 const RegId& reg = si->srcRegIdx(idx);
136 assert(reg.isFloatReg());
137 return thread.readFloatReg(reg.index());
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500138 }
139
140 TheISA::FloatRegBits
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100141 readFloatRegOperandBits(const StaticInst *si, int idx) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500142 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500143 const RegId& reg = si->srcRegIdx(idx);
144 assert(reg.isFloatReg());
145 return thread.readFloatRegBits(reg.index());
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500146 }
147
Rekai Gonzalez-Alberquilla00da0892017-04-05 13:24:00 -0500148 const TheISA::VecRegContainer&
149 readVecRegOperand(const StaticInst *si, int idx) const override
150 {
151 const RegId& reg = si->srcRegIdx(idx);
152 assert(reg.isVecReg());
153 return thread.readVecReg(reg);
154 }
155
156 TheISA::VecRegContainer&
157 getWritableVecRegOperand(const StaticInst *si, int idx) override
158 {
159 const RegId& reg = si->destRegIdx(idx);
160 assert(reg.isVecReg());
161 return thread.getWritableVecReg(reg);
162 }
163
164 TheISA::VecElem
165 readVecElemOperand(const StaticInst *si, int idx) const override
166 {
167 const RegId& reg = si->srcRegIdx(idx);
168 assert(reg.isVecReg());
169 return thread.readVecElem(reg);
170 }
171
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500172 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100173 setIntRegOperand(const StaticInst *si, int idx, IntReg val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500174 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500175 const RegId& reg = si->destRegIdx(idx);
176 assert(reg.isIntReg());
177 thread.setIntReg(reg.index(), val);
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500178 }
179
180 void
181 setFloatRegOperand(const StaticInst *si, int idx,
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100182 TheISA::FloatReg val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500183 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500184 const RegId& reg = si->destRegIdx(idx);
185 assert(reg.isFloatReg());
186 thread.setFloatReg(reg.index(), val);
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500187 }
188
189 void
190 setFloatRegOperandBits(const StaticInst *si, int idx,
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100191 TheISA::FloatRegBits val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500192 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500193 const RegId& reg = si->destRegIdx(idx);
194 assert(reg.isFloatReg());
195 thread.setFloatRegBits(reg.index(), val);
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500196 }
197
Rekai Gonzalez-Alberquilla00da0892017-04-05 13:24:00 -0500198 void
199 setVecRegOperand(const StaticInst *si, int idx,
200 const TheISA::VecRegContainer& val) override
201 {
202 const RegId& reg = si->destRegIdx(idx);
203 assert(reg.isVecReg());
204 thread.setVecReg(reg, val);
205 }
206
207 /** Vector Register Lane Interfaces. */
208 /** @{ */
209 /** Reads source vector 8bit operand. */
210 ConstVecLane8
211 readVec8BitLaneOperand(const StaticInst *si, int idx) const
212 override
213 {
214 const RegId& reg = si->srcRegIdx(idx);
215 assert(reg.isVecReg());
216 return thread.readVec8BitLaneReg(reg);
217 }
218
219 /** Reads source vector 16bit operand. */
220 ConstVecLane16
221 readVec16BitLaneOperand(const StaticInst *si, int idx) const
222 override
223 {
224 const RegId& reg = si->srcRegIdx(idx);
225 assert(reg.isVecReg());
226 return thread.readVec16BitLaneReg(reg);
227 }
228
229 /** Reads source vector 32bit operand. */
230 ConstVecLane32
231 readVec32BitLaneOperand(const StaticInst *si, int idx) const
232 override
233 {
234 const RegId& reg = si->srcRegIdx(idx);
235 assert(reg.isVecReg());
236 return thread.readVec32BitLaneReg(reg);
237 }
238
239 /** Reads source vector 64bit operand. */
240 ConstVecLane64
241 readVec64BitLaneOperand(const StaticInst *si, int idx) const
242 override
243 {
244 const RegId& reg = si->srcRegIdx(idx);
245 assert(reg.isVecReg());
246 return thread.readVec64BitLaneReg(reg);
247 }
248
249 /** Write a lane of the destination vector operand. */
250 template <typename LD>
251 void
252 setVecLaneOperandT(const StaticInst *si, int idx,
253 const LD& val)
254 {
255 const RegId& reg = si->destRegIdx(idx);
256 assert(reg.isVecReg());
257 return thread.setVecLane(reg, val);
258 }
259 virtual void
260 setVecLaneOperand(const StaticInst *si, int idx,
261 const LaneData<LaneSize::Byte>& val) override
262 {
263 setVecLaneOperandT(si, idx, val);
264 }
265 virtual void
266 setVecLaneOperand(const StaticInst *si, int idx,
267 const LaneData<LaneSize::TwoByte>& val) override
268 {
269 setVecLaneOperandT(si, idx, val);
270 }
271 virtual void
272 setVecLaneOperand(const StaticInst *si, int idx,
273 const LaneData<LaneSize::FourByte>& val) override
274 {
275 setVecLaneOperandT(si, idx, val);
276 }
277 virtual void
278 setVecLaneOperand(const StaticInst *si, int idx,
279 const LaneData<LaneSize::EightByte>& val) override
280 {
281 setVecLaneOperandT(si, idx, val);
282 }
283 /** @} */
284
285 void
286 setVecElemOperand(const StaticInst *si, int idx,
287 const TheISA::VecElem val) override
288 {
289 const RegId& reg = si->destRegIdx(idx);
290 assert(reg.isVecReg());
291 thread.setVecElem(reg, val);
292 }
293
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500294 bool
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100295 readPredicate() override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500296 {
297 return thread.readPredicate();
298 }
299
300 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100301 setPredicate(bool val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500302 {
303 thread.setPredicate(val);
304 }
305
306 TheISA::PCState
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100307 pcState() const override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500308 {
309 return thread.pcState();
310 }
311
312 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100313 pcState(const TheISA::PCState &val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500314 {
315 thread.pcState(val);
316 }
317
318 TheISA::MiscReg
Andreas Hanssond0e1b8a2015-02-16 03:33:28 -0500319 readMiscRegNoEffect(int misc_reg) const
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500320 {
321 return thread.readMiscRegNoEffect(misc_reg);
322 }
323
324 TheISA::MiscReg
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100325 readMiscReg(int misc_reg) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500326 {
327 return thread.readMiscReg(misc_reg);
328 }
329
330 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100331 setMiscReg(int misc_reg, const TheISA::MiscReg &val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500332 {
333 thread.setMiscReg(misc_reg, val);
334 }
335
336 TheISA::MiscReg
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100337 readMiscRegOperand(const StaticInst *si, int idx) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500338 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500339 const RegId& reg = si->srcRegIdx(idx);
340 assert(reg.isMiscReg());
341 return thread.readMiscReg(reg.index());
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500342 }
343
344 void
345 setMiscRegOperand(const StaticInst *si, int idx,
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100346 const TheISA::MiscReg &val) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500347 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500348 const RegId& reg = si->destRegIdx(idx);
349 assert(reg.isMiscReg());
350 return thread.setMiscReg(reg.index(), val);
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500351 }
352
353 Fault
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100354 hwrei() override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500355 {
356#if THE_ISA == ALPHA_ISA
357 return thread.hwrei();
358#else
359 return NoFault;
360#endif
361 }
362
363 bool
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100364 simPalCheck(int palFunc) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500365 {
366#if THE_ISA == ALPHA_ISA
367 return thread.simPalCheck(palFunc);
368#else
369 return false;
370#endif
371 }
372
373 void
Brandon Pottera5802c82015-07-20 09:15:21 -0500374 syscall(int64_t callnum, Fault *fault) override
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100375 {
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500376 if (FullSystem)
377 panic("Syscall emulation isn't available in FS mode.\n");
378
Brandon Pottera5802c82015-07-20 09:15:21 -0500379 thread.syscall(callnum, fault);
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500380 }
381
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100382 ThreadContext *tcBase() override { return thread.getTC(); }
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500383
384 /* @todo, should make stCondFailures persistent somewhere */
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100385 unsigned int readStCondFailures() const override { return 0; }
386 void setStCondFailures(unsigned int st_cond_failures) override {}
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500387
Andreas Sandberg53e777d2015-08-07 09:59:13 +0100388 ContextID contextId() { return thread.contextId(); }
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500389 /* ISA-specific (or at least currently ISA singleton) functions */
390
391 /* X86: TLB twiddling */
392 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100393 demapPage(Addr vaddr, uint64_t asn) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500394 {
395 thread.getITBPtr()->demapPage(vaddr, asn);
396 thread.getDTBPtr()->demapPage(vaddr, asn);
397 }
398
Nilay Vaishaafa5c32015-07-28 01:58:04 -0500399 TheISA::CCReg
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100400 readCCRegOperand(const StaticInst *si, int idx) override
Nilay Vaishaafa5c32015-07-28 01:58:04 -0500401 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500402 const RegId& reg = si->srcRegIdx(idx);
403 assert(reg.isCCReg());
404 return thread.readCCReg(reg.index());
Nilay Vaishaafa5c32015-07-28 01:58:04 -0500405 }
406
407 void
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100408 setCCRegOperand(const StaticInst *si, int idx, TheISA::CCReg val) override
Nilay Vaishaafa5c32015-07-28 01:58:04 -0500409 {
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500410 const RegId& reg = si->destRegIdx(idx);
411 assert(reg.isCCReg());
412 thread.setCCReg(reg.index(), val);
Nilay Vaishaafa5c32015-07-28 01:58:04 -0500413 }
414
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500415 void
416 demapInstPage(Addr vaddr, uint64_t asn)
417 {
418 thread.getITBPtr()->demapPage(vaddr, asn);
419 }
420
421 void
422 demapDataPage(Addr vaddr, uint64_t asn)
423 {
424 thread.getDTBPtr()->demapPage(vaddr, asn);
425 }
426
427 /* ALPHA/POWER: Effective address storage */
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100428 void setEA(Addr ea) override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500429 {
430 inst->ea = ea;
431 }
432
433 BaseCPU *getCpuPtr() { return &cpu; }
434
435 /* POWER: Effective address storage */
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100436 Addr getEA() const override
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500437 {
438 return inst->ea;
439 }
440
441 /* MIPS: other thread register reading/writing */
442 uint64_t
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500443 readRegOtherThread(const RegId& reg, ThreadID tid = InvalidThreadID)
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500444 {
445 SimpleThread *other_thread = (tid == InvalidThreadID
446 ? &thread : cpu.threads[tid]);
447
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500448 switch (reg.classValue()) {
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500449 case IntRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500450 return other_thread->readIntReg(reg.index());
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500451 break;
452 case FloatRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500453 return other_thread->readFloatRegBits(reg.index());
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500454 break;
455 case MiscRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500456 return other_thread->readMiscReg(reg.index());
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500457 default:
458 panic("Unexpected reg class! (%s)",
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500459 reg.className());
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500460 return 0;
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500461 }
462 }
463
464 void
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500465 setRegOtherThread(const RegId& reg, const TheISA::MiscReg &val,
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500466 ThreadID tid = InvalidThreadID)
467 {
468 SimpleThread *other_thread = (tid == InvalidThreadID
469 ? &thread : cpu.threads[tid]);
470
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500471 switch (reg.classValue()) {
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500472 case IntRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500473 return other_thread->setIntReg(reg.index(), val);
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500474 break;
475 case FloatRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500476 return other_thread->setFloatRegBits(reg.index(), val);
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500477 break;
478 case MiscRegClass:
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500479 return other_thread->setMiscReg(reg.index(), val);
Nathanael Premillieu5e8287d2017-04-05 12:46:06 -0500480 default:
481 panic("Unexpected reg class! (%s)",
Rekai Gonzalez-Alberquillaa473b5a2017-04-05 13:14:34 -0500482 reg.className());
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500483 }
484 }
Marc Orrbf807342014-11-06 05:42:22 -0600485
486 public:
487 // monitor/mwait funtions
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100488 void armMonitor(Addr address) override
Mitch Hayengaff4009a2016-07-21 17:19:16 +0100489 { getCpuPtr()->armMonitor(inst->id.threadId, address); }
490
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100491 bool mwait(PacketPtr pkt) override
Mitch Hayengaff4009a2016-07-21 17:19:16 +0100492 { return getCpuPtr()->mwait(inst->id.threadId, pkt); }
493
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100494 void mwaitAtomic(ThreadContext *tc) override
Mitch Hayengaff4009a2016-07-21 17:19:16 +0100495 { return getCpuPtr()->mwaitAtomic(inst->id.threadId, tc, thread.dtb); }
496
Reiley Jeapaulff8257c2016-08-15 12:00:36 +0100497 AddressMonitor *getAddrMonitor() override
Mitch Hayengaff4009a2016-07-21 17:19:16 +0100498 { return getCpuPtr()->getCpuAddrMonitor(inst->id.threadId); }
Andrew Bardsley0e8a90f2014-07-23 16:09:04 -0500499};
500
501}
502
503#endif /* __CPU_MINOR_EXEC_CONTEXT_HH__ */