diff options
Diffstat (limited to 'src/kern/linux/events.cc')
-rw-r--r-- | src/kern/linux/events.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/kern/linux/events.cc b/src/kern/linux/events.cc index 60aa857ac..75c2b6f7f 100644 --- a/src/kern/linux/events.cc +++ b/src/kern/linux/events.cc @@ -44,11 +44,13 @@ #include <sstream> #include "base/trace.hh" +#include "arch/utility.hh" #include "cpu/thread_context.hh" #include "kern/linux/events.hh" #include "kern/linux/printk.hh" #include "kern/system_events.hh" #include "sim/arguments.hh" +#include "sim/pseudo_inst.hh" #include "sim/system.hh" namespace Linux { @@ -66,4 +68,27 @@ DebugPrintkEvent::process(ThreadContext *tc) SkipFuncEvent::process(tc); } +void +UDelayEvent::process(ThreadContext *tc) +{ + int arg_num = 0; + + // Get the time in native size + uint64_t time = TheISA::getArgument(tc, arg_num, (uint16_t)-1, false); + + // convert parameter to ns + if (argDivToNs) + time /= argDivToNs; + + time *= argMultToNs; + + // Convert ns to ticks + time *= SimClock::Int::ns; + + SkipFuncEvent::process(tc); + + PseudoInst::quiesceNs(tc, time); +} + + } // namespace linux |