Skip to content
Commit 0fc9c9f4 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Anas Nashif
Browse files

drivers/timer/arm_arch_timer: driver revamp



Couple issues:

- `sys_clock_set_timeout()` should not base its `mtime` on the current
  time either. Tracking the `last_tick` and `last_elapsed` values avoids
  the need for all the tick rounding computation.

- The MIN_DELAY thing is pointless. The hardware performs a signed
  comparison. If the delay gets close or even behind current time then
  the IRQ will be triggered right away. This is unlikely to happen very
  often anyway so the constant overhead is uncalled for.

- Runtime 64-bits divisions on 32-bits hardware are very expensive.

- The timer must be enabled before the count can return a sensible
  value during driver init (at least on qemu_cortex_a9).

Discussion in PR #54919 applies here too.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent a8c0123d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment