mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-16 19:04:53 +08:00
The BSP linked the software CPU counter of bsps/shared. That counter counts the calls to _CPU_Counter_read() and not the time. rtems_counter_delay_nanoseconds() therefore delayed by a count of calls. getentropy() took no entropy from the time. The AXI timer of this BSP has two counters and the clock driver uses the first. Run the second as a free running up counter of the full width and read it as the CPU counter. It wraps at the width of the counter, so it needs no interrupt to carry a period. A reader never sees it go backwards. The CPU counter step of the system initialization starts it, so a system without a clock driver gets the counter as well. The tm27 support of the timing tests uses the second counter where the interrupt controller accepts no request in software. That test takes the counter for its duration. Close #5726. Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>