genode/repos/os/src
Martin Stein 399e1586be timer: generic timer_ticks_to_us implementation
There are hardware timers whose frequency can't be expressed as
ticks-per-microsecond integer-value because only a ticks-per-millisecond
integer-value is precise enough. We don't want to use expensive
floating-point values here but nonetheless want to translate from ticks
to time with microseconds precision. Thus, we split the input in two and
translate both parts separately. This way, we can raise precision by
shifting the values to their optimal bit position. Afterwards, the results
are shifted back and merged together again.

As this algorithm is not so trivial anymore and used by at least three
timer drivers (base-hw/x86_64, base-hw/cortex_a9, timer/pit), move it to a
generic header to avoid redundancy.

Ref #2400
2017-08-28 16:49:49 +02:00
..
app VFS: nonblocking interface 2017-08-28 16:49:38 +02:00
drivers timer: generic timer_ticks_to_us implementation 2017-08-28 16:49:49 +02:00
init init: avoid repeated config XML parsing 2017-08-28 16:49:37 +02:00
lib timer connection: fix division by null 2017-08-28 16:49:49 +02:00
server VFS: nonblocking interface 2017-08-28 16:49:38 +02:00
test test/timeout: use elapsed_us instead of elapsed_ms 2017-08-28 16:49:49 +02:00