diff --git a/repos/base-hw/src/core/spec/rpi/timer.cc b/repos/base-hw/src/core/spec/rpi/timer.cc index 68e18a4c21..d3066e4698 100644 --- a/repos/base-hw/src/core/spec/rpi/timer.cc +++ b/repos/base-hw/src/core/spec/rpi/timer.cc @@ -35,11 +35,11 @@ void Timer::_start_one_shot(time_t const ticks) time_t Timer::_ticks_to_us(time_t const ticks) const { - return (ticks / Driver::TICS_PER_MS) * 1000; } + return ticks / Driver::TICS_PER_US; } time_t Timer::us_to_ticks(time_t const us) const { - return (us / 1000) * Driver::TICS_PER_MS; } + return us * Driver::TICS_PER_US; } time_t Timer::_max_value() const { diff --git a/repos/base-hw/src/core/spec/rpi/timer_driver.h b/repos/base-hw/src/core/spec/rpi/timer_driver.h index daa703a4c1..9ad4a9f709 100644 --- a/repos/base-hw/src/core/spec/rpi/timer_driver.h +++ b/repos/base-hw/src/core/spec/rpi/timer_driver.h @@ -29,7 +29,7 @@ namespace Kernel { class Timer_driver; } */ struct Kernel::Timer_driver : Genode::Mmio { - enum { TICS_PER_MS = Board::SYSTEM_TIMER_CLOCK / 1000 }; + enum { TICS_PER_US = Board::SYSTEM_TIMER_CLOCK / 1000 / 1000 }; struct Cs : Register<0x0, 32> { struct M1 : Bitfield<1, 1> { }; }; struct Clo : Register<0x4, 32> { };