kern: Stop using a pseudo instruction to quiesce the ThreadContext.
authorGabe Black <gabeblack@google.com>
Thu, 12 Dec 2019 04:17:39 +0000 (20:17 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 12 Mar 2020 07:21:13 +0000 (07:21 +0000)
The pseudo instruction implementation is very short, and so doing the
work it was doing directly doesn't really add much to the
implementation of the udelay events. By not calling the pseudo
instruction we also uncouple these unrelated mechanisms and don't,
for instance, cause pseudo instruction debug output every time udelay
executes.

Change-Id: I5c9b32509562487e53b2acfa1a3f6226d33d1cfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23748
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>

src/kern/freebsd/events.cc
src/kern/linux/events.cc

index 15954d6726928c44429fd5e773d32330ba7d454f..a9e2854db94458e9de1d39b302bdf119f7a15d36 100644 (file)
@@ -40,7 +40,6 @@
 #include "debug/DebugPrintf.hh"
 #include "kern/system_events.hh"
 #include "sim/arguments.hh"
-#include "sim/pseudo_inst.hh"
 #include "sim/system.hh"
 
 namespace FreeBSD {
@@ -69,9 +68,8 @@ UDelayEvent::process(ThreadContext *tc)
     // __delay and __loop_delay functions. One form involves setting quiesce
     // time to 0 with the assumption that quiesce will not happen. To avoid
     // the quiesce handling in this case, only execute the quiesce if time > 0.
-    if (time > 0) {
-        PseudoInst::quiesceNs(tc, time);
-    }
+    if (time > 0)
+        tc->quiesceTick(curTick() + SimClock::Int::ns * time);
 }
 
 } // namespace FreeBSD
index 199dfc68ff278ac02878f07b628b376604df6f62..3c0cbbf88f42851f36418d37be2a95a92d8e35d7 100644 (file)
@@ -52,7 +52,7 @@
 #include "kern/linux/printk.hh"
 #include "kern/system_events.hh"
 #include "sim/arguments.hh"
-#include "sim/pseudo_inst.hh"
+#include "sim/core.hh"
 #include "sim/system.hh"
 
 namespace Linux {
@@ -90,9 +90,8 @@ UDelayEvent::process(ThreadContext *tc)
     // __delay and __loop_delay functions. One form involves setting quiesce
     // time to 0 with the assumption that quiesce will not happen. To avoid
     // the quiesce handling in this case, only execute the quiesce if time > 0.
-    if (time > 0) {
-        PseudoInst::quiesceNs(tc, time);
-    }
+    if (time > 0)
+        tc->quiesceTick(curTick() + SimClock::Int::ns * time);
 }
 
 void