genode/repos/os/src/drivers
Martin Stein 99ddaaa9d7 timer epit: fix multi-wraps and bug in rate limit
Multi-wraps
-----------

Previously, on every new timeout, we programmed registers LR=timeout and
CMP=0. The counter than counted from LR down to 0, triggered the IRQ,
jumped back to LR, and counted down again. If one installed small
timeouts (< 1000 us), it was likely that the counter wrapped multiple
times before we were able to read it out. Initially, this was not a big
issue as the additional wraps were simply ignored and the amount of time
lost through this was not big. But when we want to do correct rate
limitation, multiple wraps cause an overflow in the additional
calculations, and this has a big effect on the resulting time value.

Thus, we now program the counter to start from ~0 and count down to 0.
We set CMP=~0-timeout so that the timer still triggers the IRQ at the right
time. The counter continues counting down after the IRQ has triggered until
we install a new timeout. We do not consider anymore that the counter wraps.
The maximum timeout is set to half the maximum counter value, so, we should
be able to install a new timeout before the counter wraps.

Rate limit for time updates
---------------------------

In the time span between two interrupts we have to remember how many ticks
we have already added to the time value. This is because at each call of
curr_time we can only see how many ticks have passed since the last call of
schedule_timeout and not since the last call of curr_time. But we want to
limit the rate of time updates in curr_time. With the member for ticks that
were already added since the last call to schedule_timeout we can then
calculate how many are yet to be added.
2017-11-30 11:23:20 +01:00
..
acpi acpi_drv: use platform_info for rsdt/xsdt lookup 2017-06-29 11:59:50 +02:00
ahci ahci: log vendor/device IDs as hex 2017-11-06 13:57:19 +01:00
audio/spec/linux Streamline exception types 2017-05-31 13:16:07 +02:00
framebuffer fb_boot_drv: evaluate fb pitch 2017-11-24 09:02:04 +01:00
gpio/spec Fix source file location in RPi GPIO driver 2017-05-31 13:16:21 +02:00
gpu/intel os: add Gpu driver for Intel Gen8 HD graphics 2017-08-30 09:59:57 +02:00
input ps2_drv: respond to dynamic reconfiguration 2017-11-30 11:23:07 +01:00
nic/spec os: removal of deprecated os/config.h (fix #2431) 2017-05-31 13:16:22 +02:00
platform/spec platform_drv: separate acpi and system feature 2017-11-30 11:23:14 +01:00
rtc/spec/x86 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
sd_card default ahci_drv and part_blk Block sessions to read-only 2017-08-28 16:49:51 +02:00
timer timer epit: fix multi-wraps and bug in rate limit 2017-11-30 11:23:20 +01:00
uart os: removal of deprecated os/config.h (fix #2431) 2017-05-31 13:16:22 +02:00
usb_block usb: avoid pagefault during session destruction 2017-11-09 12:18:05 +01:00