changeset c9f52fae6b37 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c9f52fae6b37
description:
        O3CPU: Add a hack to ensure that nextPC is set correctly after syscalls.
        Just check CPU's nextPC before and after syscall and if it changes,
        update this instruction's nextPC because the syscall must have changed
        the nextPC.

diffstat:

1 file changed, 4 insertions(+)
src/cpu/o3/alpha/dyn_inst_impl.hh |    4 ++++

diffs (19 lines):

diff -r 07c10d7dd62d -r c9f52fae6b37 src/cpu/o3/alpha/dyn_inst_impl.hh
--- a/src/cpu/o3/alpha/dyn_inst_impl.hh Tue Sep 23 20:38:02 2008 -0700
+++ b/src/cpu/o3/alpha/dyn_inst_impl.hh Fri Sep 26 07:44:06 2008 -0700
@@ -161,7 +161,15 @@
 void
 AlphaDynInst<Impl>::syscall(int64_t callnum)
 {
+    // HACK: check CPU's nextPC before and after syscall. If it
+    // changes, update this instruction's nextPC because the syscall
+    // must have changed the nextPC.
+    Addr cpu_next_pc = this->cpu->readNextPC(this->threadNumber);
     this->cpu->syscall(callnum, this->threadNumber);
+    Addr new_next_pc = this->cpu->readNextPC(this->threadNumber);
+    if (cpu_next_pc != new_next_pc) {
+        this->setNextPC(new_next_pc);
+    }
 }
 #endif
 
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to