dxd - dynax driver framework 2.7.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::clock Class Referenceabstract

kernel-mode periodic software clock, mirroring dx::clock's tick()/run()/halt() shape More...

#include <dxd_clock.h>

Inheritance diagram for dxd::clock:
Collaboration diagram for dxd::clock:

Public Member Functions

 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 }

Protected Member Functions

os_result prio (priority priority)
os_result run ()
 IOKit process thread start.

Static Protected Member Functions

static unsigned int prio ()
static unsigned int prio ()

Protected Attributes

os_result status

Detailed Description

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 KTIMER after every tick() and waits on it, so a derived class's tick() body runs without DISPATCH_LEVEL restrictions - unlike a DPC-driven timer. Re-arming against an accumulated absolute due time each iteration (rather than relying on KTIMER's own millisecond-granularity Period reload) avoids drift and keeps sub-millisecond period precision, needed at small buffer sizes.

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.

Member Enumeration Documentation

◆ priority

enum class dxd::process::priority
stronginherited
Enumerator
low 

Lowest thread priority level.

realtime 

Lowest realtime priority level.

high 

Highest thread priority level.

Constructor & Destructor Documentation

◆ clock()

dxd::clock::clock ( )
inline

◆ ~clock()

virtual dxd::clock::~clock ( )
inlinevirtual

virtual destructur

clock base class needs virtual destructor; although its a dummy; to ensure inherited and composite objects to be correctly destructed.

Here is the call graph for this function:

Member Function Documentation

◆ halt()

void dxd::clock::halt ( )
inlinenoexcept

stop and join the clock thread; no-op if never run()

<wake launch()'s wait_any() so it observes running==false and exits

Here is the caller graph for this function:

◆ prio() [1/3]

unsigned int dxd::process::prio ( )
inlinestaticinherited

◆ prio() [2/3]

unsigned int dxd::process::prio ( )
inlinestaticinherited

◆ prio() [3/3]

os_result dxd::process::prio ( priority priority)
inlineinherited

◆ run() [1/2]

os_result dxd::clock::run ( int64_t period)
inline

create and start the clock thread (autonomous mode)

Parameters
periodtick period, 100ns units (see dxd::scale)
Here is the call graph for this function:

◆ run() [2/2]

os_result dxd::process::run ( )
inlineinherited

IOKit process thread start.

run() starts this process. The internal mechanism blocks object termination until thread start() returns.

Here is the caller graph for this function:

◆ tick()

virtual void dxd::clock::tick ( )
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.

Member Data Documentation

◆ status

os_result dxd::process::status
inherited

The documentation for this class was generated from the following file:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.