genode/repos/os/src
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
..
app VFS: nonblocking interface 2017-08-28 16:49:38 +02:00
drivers timer pit: handle and display bad latency 2017-10-05 17:39:55 +02:00
init init: avoid repeated config XML parsing 2017-08-28 16:49:37 +02:00
lib alarm: fix information loss due to int-cast 2017-10-05 17:39:56 +02:00
server server/vfs: status completes or throw Invalid_handle 2017-10-05 17:39:55 +02:00
test sel4: adjust cap ram quota of fault_detection.run 2017-08-30 10:00:01 +02:00