mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-20 17:11:45 +00:00
hw cortex_a9: fix bug in kernel timer
A bug in the timer-ticks-to-microseconds translation of the kernel timer caused the user time to periodically get stuck for about 32 milliseconds and then jump forward to the normal level again. Ref #2400
This commit is contained in:
parent
9b1c26ab7f
commit
889db34cc3
@ -63,11 +63,11 @@ time_t Timer::_ticks_to_us(time_t const ticks) const
|
||||
MSB_RSHIFT = 10,
|
||||
LSB_LSHIFT = HALF_WIDTH - MSB_RSHIFT,
|
||||
};
|
||||
time_t const msb = (((ticks >> MSB_RSHIFT)
|
||||
time_t const msb = ((((ticks & MSB_MASK) >> MSB_RSHIFT)
|
||||
* 1000) / Driver::TICS_PER_MS) << MSB_RSHIFT;
|
||||
time_t const lsb = ((((ticks & LSB_MASK) << LSB_LSHIFT)
|
||||
* 1000) / Driver::TICS_PER_MS) >> LSB_LSHIFT;
|
||||
return (msb & MSB_MASK) | lsb;
|
||||
* 1000) / Driver::TICS_PER_MS) >> LSB_LSHIFT;
|
||||
return msb + lsb;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user