cpu: implements vector registers
[gem5.git] / src / sim / pseudo_inst.cc
index 0dcf5c32b28985deabc4bb28324ad9cdd11d0c82..80737003c4e6de7e25cdd763d81c1f69651741aa 100644 (file)
@@ -52,6 +52,7 @@
 #include "arch/kernel_stats.hh"
 #include "arch/utility.hh"
 #include "arch/vtophys.hh"
+#include "arch/pseudo_inst.hh"
 #include "base/debug.hh"
 #include "base/output.hh"
 #include "config/the_isa.hh"
@@ -64,6 +65,7 @@
 #include "debug/WorkItems.hh"
 #include "params/BaseCPU.hh"
 #include "sim/full_system.hh"
+#include "sim/process.hh"
 #include "sim/pseudo_inst.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_events.hh"
@@ -98,8 +100,10 @@ pseudoInst(ThreadContext *tc, uint8_t func, uint8_t subfunc)
     // used the Argument class, but due to the possible side effects
     // from getArgument, it'd most likely break.
     int arg_num(0);
-    for (int i = 0; i < sizeof(args) / sizeof(*args); ++i)
-        args[arg_num++] = getArgument(tc, arg_num, sizeof(uint64_t), false);
+    for (int i = 0; i < sizeof(args) / sizeof(*args); ++i) {
+        args[arg_num] = getArgument(tc, arg_num, sizeof(uint64_t), false);
+        ++arg_num;
+    }
 
     switch (func) {
       case 0x00: // arm_func
@@ -196,6 +200,15 @@ pseudoInst(ThreadContext *tc, uint8_t func, uint8_t subfunc)
         warn("Unimplemented m5 op (0x%x)\n", func);
         break;
 
+      /* SE mode functions */
+      case 0x60: // syscall_func
+        m5Syscall(tc);
+        break;
+
+      case 0x61: // pagefault_func
+        m5PageFault(tc);
+        break;
+
       default:
         warn("Unhandled m5 op: 0x%x\n", func);
         break;
@@ -345,7 +358,7 @@ m5exit(ThreadContext *tc, Tick delay)
 {
     DPRINTF(PseudoInst, "PseudoInst::m5exit(%i)\n", delay);
     Tick when = curTick() + delay * SimClock::Int::ns;
-    exitSimLoop("m5_exit instruction encountered", 0, when);
+    exitSimLoop("m5_exit instruction encountered", 0, when, 0, true);
 }
 
 void
@@ -353,7 +366,7 @@ m5fail(ThreadContext *tc, Tick delay, uint64_t code)
 {
     DPRINTF(PseudoInst, "PseudoInst::m5fail(%i, %i)\n", delay, code);
     Tick when = curTick() + delay * SimClock::Int::ns;
-    exitSimLoop("m5_fail instruction encountered", code, when);
+    exitSimLoop("m5_fail instruction encountered", code, when, 0, true);
 }
 
 void