diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2011-03-17 19:24:37 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2011-03-17 19:24:37 -0500 |
commit | 6daf44dae6dbe931e2a1493cd0e33ca9732509dd (patch) | |
tree | f8815e56c08a92059b5d576728f564c7bfce7bf0 /src/kern/linux/events.hh | |
parent | c4de6a05229bbc42ae4b247541c823edb8d4ca76 (diff) | |
parent | 63eb337b3b93ab71ab3157ec6487901d4fc6cda6 (diff) | |
download | gem5-6daf44dae6dbe931e2a1493cd0e33ca9732509dd.tar.xz |
Automated merge with ssh://hg@repo.m5sim.org/m5
Diffstat (limited to 'src/kern/linux/events.hh')
-rw-r--r-- | src/kern/linux/events.hh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/kern/linux/events.hh b/src/kern/linux/events.hh index e36a72dde..3f5f2526f 100644 --- a/src/kern/linux/events.hh +++ b/src/kern/linux/events.hh @@ -44,6 +44,33 @@ class DebugPrintkEvent : public SkipFuncEvent virtual void process(ThreadContext *xc); }; +/** A class to skip udelay() and related calls in the kernel. + * This class has two additional parameters that take the argument to udelay and + * manipulated it to come up with ns and eventually ticks to quiesce for. + * See descriptions of argDivToNs and argMultToNs below. + */ +class UDelayEvent : public SkipFuncEvent +{ + private: + /** value to divide arg by to create ns. This is present beacues the linux + * kernel code sometime precomputes the first multiply that is done in + * udelay() if the parameter is a constant. We need to undo it so here is + * how. */ + uint64_t argDivToNs; + + /** value to multiple arg by to create ns. Nominally, this is 1000 to + * convert us to ns, but since linux can do some preprocessing of constant + * values something else might be required. */ + uint64_t argMultToNs; + + public: + UDelayEvent(PCEventQueue *q, const std::string &desc, Addr addr, + uint64_t mult, uint64_t div) + : SkipFuncEvent(q, desc, addr), argDivToNs(div), argMultToNs(mult) {} + virtual void process(ThreadContext *xc); +}; + + } #endif |