Updated: April 19, 2023 |
To keep QNX Neutrino clocks on track, you have the following options:
In order to facilitate applying time corrections to CLOCK_REALTIME without having the system experience abrupt steps in time (or even having time jump backwards), the ClockAdjust() call provides the option to specify an interval over which the time correction is to be applied. This has the effect of speeding or retarding time over a specified interval until the system has synchronized to the indicated current time. This service can be used to implement network-coordinated time averaging between multiple nodes on a network.
The libmod_timecc.a kernel module uses ClockCycles() as a time source by converting its value, since boot, to nanoseconds to update CLOCK_MONOTONIC. See ClockCycles() for more information.
[module=timecc] PATH=/proc/boot ./procnto-smp-instr -vvSee the module attribute in the mkifs page for more information.
Be sure to set the timer_prog_time variable in qtime to zero (0). This can be done through the -f option in startup-*. Keep in mind, you don't need to set the timer_freq option when using the -f option in startup-*. The QTIME_FLAG_TIMECC flag is not set by startup-*, either automatically or via a command-line. The kernel sets the flag and is only visible once procnto is running. When set, this flag indicates that the libmod_timecc.a module is in use. See qtime for more information.
To avoid any interference with the module's timing, do not attach to the interrupt used by libmod_timecc.a from other processes. Only the timer hardware used by libmod_timecc.a can be a source of interrupts on the same interrupt level. This means that the interrupt level cannot be shared. The interrupt source on an x86_64 system is the LAPIC Timer. On an Armv8-A system, it is the Generic Timer.
When using InterruptHookIdle2(), the _NTO_IH_RESP_SYNC_TIME bit is ignored.
If you are using QNX OS for Safety, you must use libmod_timecc-safety.a.