pseudo inst: Add new wake cpu instruction for sending a message to wake a cpu.
authorNathan Binkert <nate@binkert.org>
Sat, 24 Jan 2009 15:27:22 +0000 (07:27 -0800)
committerNathan Binkert <nate@binkert.org>
Sat, 24 Jan 2009 15:27:22 +0000 (07:27 -0800)
It's instantaneous and so it's somewhat bogus, but it's a first step.

src/arch/alpha/isa/decoder.isa
src/sim/pseudo_inst.cc
src/sim/pseudo_inst.hh
util/m5/m5op.h
util/m5/m5op_alpha.S
util/m5/m5ops.h

index f057f00ccdff91f66fc05075dfa1fa625c2649c9..67bc5c7a26e59a26c9286f414207271a243cd3fa 100644 (file)
@@ -815,6 +815,9 @@ decode OPCODE default Unknown::unknown() {
             0x07: rpns({{
                 R0 = PseudoInst::rpns(xc->tcBase());
             }}, IsNonSpeculative, IsUnverifiable);
+            0x09: wakeCPU({{
+                PseudoInst::wakeCPU(xc->tcBase(), R16);
+            }}, IsNonSpeculative, IsUnverifiable);
             0x10: deprecated_ivlb({{
                 warn_once("Obsolete M5 ivlb instruction encountered.\n");
             }});
index 130a2f0fe98585513698db44974443d6dc121550..f1cf2835dc88041a25fcc805e7d0412239edf2a2 100644 (file)
@@ -137,6 +137,15 @@ rpns(ThreadContext *tc)
     return curTick / Clock::Int::ns;
 }
 
+void
+wakeCPU(ThreadContext *tc, uint64_t cpuid)
+{
+    System *sys = tc->getSystemPtr();
+    ThreadContext *other_tc = sys->threadContexts[cpuid];
+    if (other_tc->status() == ThreadContext::Suspended)
+        other_tc->activate();
+}
+
 void
 m5exit(ThreadContext *tc, Tick delay)
 {
index 7d013eda7fc85b5de4570c1fe2a933f70a1ba486..30996fc3bfabff4555749aacc13f3dcb3225680c 100644 (file)
@@ -55,6 +55,7 @@ void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
 #endif
 
 uint64_t rpns(ThreadContext *tc);
+void wakeCPU(ThreadContext *tc, uint64_t cpuid);
 void m5exit(ThreadContext *tc, Tick delay);
 void resetstats(ThreadContext *tc, Tick delay, Tick period);
 void dumpstats(ThreadContext *tc, Tick delay, Tick period);
index bab2e2b9eeac170744b07f53b0e97f3354a20b9b..6377af8b73134949e190e4f33f6df9584f8fa30c 100644 (file)
@@ -40,6 +40,7 @@ void quiesceNs(uint64_t ns);
 void quiesceCycle(uint64_t cycles);
 uint64_t quiesceTime(void);
 uint64_t rpns();
+void wakeCPU(uint64_t cpuid);
 
 void m5_exit(uint64_t ns_delay);
 uint64_t m5_initparam(void);
index 77e9afe3469da08be4d6b260bb693a4986c724a7..4c04af3f641c9b1fedae10b294df3e11111e440f 100644 (file)
@@ -60,6 +60,7 @@ func:
 #define QUIESCECYC(r1) INST(m5_op, r1, 0, quiescecycle_func)
 #define QUIESCETIME INST(m5_op, 0, 0, quiescetime_func)
 #define RPNS INST(m5_op, 0, 0, rpns_func)
+#define WAKE_CPU(r1) INST(m5_op, r1, 0, wakecpu_func)
 #define M5EXIT(reg) INST(m5_op, reg, 0, exit_func)
 #define INITPARAM(reg) INST(m5_op, reg, 0, initparam_func)
 #define LOADSYMBOL(reg) INST(m5_op, reg, 0, loadsymbol_func)
@@ -81,6 +82,7 @@ SIMPLE_OP(quiesceNs, QUIESCENS(16))
 SIMPLE_OP(quiesceCycle, QUIESCECYC(16))
 SIMPLE_OP(quiesceTime, QUIESCETIME)
 SIMPLE_OP(rpns, RPNS)
+SIMPLE_OP(wakeCPU, WAKE_CPU(16))
 SIMPLE_OP(m5_exit, M5EXIT(16))
 SIMPLE_OP(m5_initparam, INITPARAM(0))
 SIMPLE_OP(m5_loadsymbol, LOADSYMBOL(0))
index ab9bdd85772cd040eea3cc0f345740471141b805..b2f896fb1116e02e81cf1b716ad46380594c17ff 100644 (file)
@@ -35,6 +35,7 @@
 #define quiescecycle_func       0x03
 #define quiescetime_func        0x04
 #define rpns_func               0x07
+#define wakecpu_func            0x09
 #define deprecated1_func        0x10 // obsolete ivlb
 #define deprecated2_func        0x11 // obsolete ivle
 #define deprecated3_func        0x20 // deprecated exit function