Files
rtems/bsps
Sebastian Huber 1c8a6b8f60 bsps/x86_64/amd64: Add a timecounter
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>
2026-08-19 11:48:54 -05:00
..
2026-08-19 11:43:52 -05:00
…
…