summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resources
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:38 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:38 -0400
commitdb8b1e4b78b7f51b673f80d4f2a1e5f5c86d4446 (patch)
treeca55fe420ad974c39432eab352147f52c23e7f48 /src/cpu/inorder/resources
parentc95fe261abab85bee247737a3d171378689891e0 (diff)
downloadgem5-db8b1e4b78b7f51b673f80d4f2a1e5f5c86d4446.tar.xz
inorder: treat SE mode syscalls as a trapping instruction
define a syscallContext to schedule the syscall and then use syscall() to actually perform the action
Diffstat (limited to 'src/cpu/inorder/resources')
-rw-r--r--src/cpu/inorder/resources/execution_unit.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cpu/inorder/resources/execution_unit.cc b/src/cpu/inorder/resources/execution_unit.cc
index 6b89c8230..77ab21b21 100644
--- a/src/cpu/inorder/resources/execution_unit.cc
+++ b/src/cpu/inorder/resources/execution_unit.cc
@@ -89,6 +89,8 @@ ExecutionUnit::execute(int slot_num)
DynInstPtr inst = reqs[slot_num]->inst;
Fault fault = NoFault;
Tick cur_tick = curTick();
+ unsigned stage_num = exec_req->getStageNum();
+ ThreadID tid = inst->readTid();
#if TRACING_ON
InstSeqNum seq_num = inst->seqNum;
#endif
@@ -149,13 +151,10 @@ ExecutionUnit::execute(int slot_num)
assert(inst->isControl());
// Set up Squash Generated By this Misprediction
- unsigned stage_num = exec_req->getStageNum();
- ThreadID tid = inst->readTid();
TheISA::PCState pc = inst->pcState();
TheISA::advancePC(pc, inst->staticInst);
inst->setPredTarg(pc);
inst->setSquashInfo(stage_num);
-
setupSquash(inst, stage_num, tid);
DPRINTF(InOrderExecute, "[tid:%i]: [sn:%i] Squashing from "
@@ -210,6 +209,15 @@ ExecutionUnit::execute(int slot_num)
seq_num,
(inst->resultType(0) == InOrderDynInst::Float) ?
inst->readFloatResult(0) : inst->readIntResult(0));
+
+#if !FULL_SYSTEM
+ // The Syscall might change the PC, so conservatively
+ // squash everything behing it
+ if (inst->isSyscall()) {
+ inst->setSquashInfo(stage_num);
+ setupSquash(inst, stage_num, tid);
+ }
+#endif
} else {
DPRINTF(InOrderExecute, "[tid:%i]: [sn:%i]: had a %s "
"fault.\n", inst->readTid(), seq_num, fault->name());