|
dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
|
kernel-mode periodic software clock, mirroring dx::clock's tick()/run()/halt() shape More...
#include <dxd_clock.h>
Public Member Functions | |
| virtual void | align (int64_t &) |
| aligns the next objective(system time, 100ns units) to an external time base, e.g. a bus frame counter; the plain period by default | |
| clock () | |
| void | halt () noexcept |
| stop and join the clock thread; no-op if never run() | |
| os_result | run (int64_t period) |
| create and start the clock thread(autonomous mode) | |
| virtual void | tick ()=0 |
| per-tick handler, called from the clock's own thread at PASSIVE_LEVEL in autonomous mode, or synchronously by the owning device in pod mode. | |
| virtual | ~clock () |
| virtual destructur | |
Protected Types | |
| enum class | priority { low = LOW_PRIORITY , realtime = LOW_REALTIME_PRIORITY , high = HIGH_PRIORITY } |
| the thread priorities a driver's own thread is raised to More... | |
Protected Member Functions | |
| void | join () |
| the completion event is signalled on launch()'s way out, the thread object only once the thread left the image; the thread itself never joins | |
| os_result | prio (priority priority) |
| os_result | run () |
Static Protected Member Functions | |
| static unsigned int | prio () |
Protected Attributes | |
| os_result | status |
kernel-mode periodic software clock, mirroring dx::clock's tick()/run()/halt() shape
A dxd::process(PASSIVE_LEVEL system thread) that re-arms an absolute-due-time high resolution EX_TIMER after every tick() and waits for its expiry on the process's own event, so a derived class's tick() body runs without DISPATCH_LEVEL restrictions - unlike a DPC-driven timer. EX_TIMER_HIGH_RESOLUTION is what keeps the sub-millisecond period precision small buffer sizes need: a KTIMER expires on the system clock interrupt alone, 15.6 ms apart. Re-arming against an accumulated absolute due time each iteration avoids drift.
A device that never calls run() and instead calls tick() directly (from an externally-driven IOCTL, e.g. ioctl::stream::clock::frame) gets the pod/puppet mode - no thread, no timer, purely reactive; see dxd/CLAUDE.md's kernel clock notes. Both modes are this same class; the difference is only whether run() was ever called.
|
stronginherited |
|
inline |
|
inlinevirtual |
virtual destructur
clock base class needs virtual destructor; although its a dummy; to ensure inherited and composite objects to be correctly destructed.
|
inlinevirtual |
aligns the next objective(system time, 100ns units) to an external time base, e.g. a bus frame counter; the plain period by default
|
inlinenoexcept |
|
inlineprotectedinherited |
the completion event is signalled on launch()'s way out, the thread object only once the thread left the image; the thread itself never joins
|
inlinestaticinherited |
create and start the clock thread(autonomous mode)
| period | tick period, 100ns units(see dxd::scale) |
|
inlineinherited |
<no thread will: keeps ~process() from waiting forever
|
pure virtual |
per-tick handler, called from the clock's own thread at PASSIVE_LEVEL in autonomous mode, or synchronously by the owning device in pod mode.
|
inherited |
| (c) copyright 2009 dynamic acoustics e.U. | generated on |