genode/repos/os/src/lib
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
..
alarm alarm: fix information loss due to int-cast 2017-10-05 17:39:56 +02:00
blit Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
net Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
server base: classify signals as I/O and application level 2017-05-31 13:15:58 +02:00
timed_semaphore timed_semaphore: fix deprecated warning 2017-05-31 13:16:19 +02:00
timeout timer connection: fix division by null 2017-08-28 16:49:49 +02:00
trace/policy Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
vfs VFS: nonblocking interface 2017-08-28 16:49:38 +02:00