From c4cc270d947ec6b87d02fdff594218fd31e933ec Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 11 Dec 2019 20:17:39 -0800 Subject: [PATCH] kern: Stop using a pseudo instruction to quiesce the ThreadContext. 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 Reviewed-by: Bobby R. Bruce Maintainer: Gabe Black --- src/kern/freebsd/events.cc | 6 ++---- src/kern/linux/events.cc | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/kern/freebsd/events.cc b/src/kern/freebsd/events.cc index 15954d672..a9e2854db 100644 --- a/src/kern/freebsd/events.cc +++ b/src/kern/freebsd/events.cc @@ -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 diff --git a/src/kern/linux/events.cc b/src/kern/linux/events.cc index 199dfc68f..3c0cbbf88 100644 --- a/src/kern/linux/events.cc +++ b/src/kern/linux/events.cc @@ -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 -- 2.30.2