From f4aff87e2548ff99d1624172f457fc6248c0607f Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 15 Nov 2017 15:32:13 +0100 Subject: [PATCH] make _timer_ticks_to_us 64bit safe fixes PIT running to fast on seL4 x86_64 --- repos/base/include/drivers/timer/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/base/include/drivers/timer/util.h b/repos/base/include/drivers/timer/util.h index 25ee3f8e80..48c74a7dc1 100644 --- a/repos/base/include/drivers/timer/util.h +++ b/repos/base/include/drivers/timer/util.h @@ -38,10 +38,10 @@ namespace Genode { RESULT_T timer_ticks_to_us(RESULT_T const ticks, TICS_PER_MS_T const ticks_per_ms) { - enum { + enum:RESULT_T { HALF_WIDTH = (sizeof(RESULT_T) << 2), - MSB_MASK = ~0UL << HALF_WIDTH, - LSB_MASK = ~0UL >> HALF_WIDTH, + MSB_MASK = ((RESULT_T)~0UL) << HALF_WIDTH, + LSB_MASK = ((RESULT_T)~0UL) >> HALF_WIDTH, MSB_RSHIFT = 10, LSB_LSHIFT = HALF_WIDTH - MSB_RSHIFT, };