mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-16 19:04:53 +08:00
The timecounter of the BSP returned the clock tick counter, so the uptime advanced once per clock tick and no time point inside a tick could be expressed. Tests which need a time source below the tick resolution cannot work with it, among them the interrupt test framework, which places its action a quarter of a tick before the tick it wants the interrupt in. spintrcritical08 ran into its iteration limit for this reason. Use the time stamp counter. It is free running, so it needs no interrupt to carry a period and a reader never sees it go backwards. The local APIC timer offers the same resolution, but its count restarts with every clock tick and the acknowledge of the tick happens before the handlers run, so a reader between the restart and the tick handler cannot tell whether a period has to be added. Calibrate it in the PIT window which already calibrates the APIC timer. Close #5693. Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>