genode/repos/os
Martin Stein 2633ff8661 alarm: fix information loss due to int-cast
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
2017-10-05 17:39:56 +02:00
..
doc Remove obsolete RAM/CAP services from run scripts 2017-05-31 13:16:22 +02:00
include alarm: fix information loss due to int-cast 2017-10-05 17:39:56 +02:00
lib sd_card: cleanup driver library structure 2017-06-29 11:59:58 +02:00
recipes depot: recipe for rump/file_system 2017-10-05 17:39:56 +02:00
run nic_router & timer* tests: prioritize timer driver 2017-09-07 11:47:15 +02:00
src alarm: fix information loss due to int-cast 2017-10-05 17:39:56 +02:00
README API documentation refinements 2017-05-31 13:16:21 +02:00

This source-code repository contains genuine low-level OS components and
interfaces of Genode. It solely depends on the framework's base API.