mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
2633ff8661
When we have two time values of an unsigned integer type and we create the difference and want to know wether it is positive or negative within the same value we loose at least one half of the value range for casting to signed integers. This was the case in the alarm scheduler when checking wether an alarm already triggered. Even worse, we casted from 'unsigned long' to 'signed int' which caused further loss on at least x86_64. Thus, big timeouts like ~0UL falsely triggered directly. Now, we use an extra boolean value to remember in which period of the time counter we are and to which period of the time counter the deadline of an alarm belongs. This boolean switches its value each time the time counter wraps. This way, we can avoid any casting by checking wether the current time is of the same period as the deadline of the alarm that we inspect. If so, the alarm is pending if "current time >= alarm deadline", otherwise it is pending if "current time < alarm deadline". Ref #2490 |
||
---|---|---|
.. | ||
doc | ||
include | ||
lib | ||
recipes | ||
run | ||
src | ||
README |
This source-code repository contains genuine low-level OS components and interfaces of Genode. It solely depends on the framework's base API.