diff --git a/repos/base-hw/src/core/spec/riscv/timer.cc b/repos/base-hw/src/core/spec/riscv/timer.cc index 4538533bfb..1747414ba5 100644 --- a/repos/base-hw/src/core/spec/riscv/timer.cc +++ b/repos/base-hw/src/core/spec/riscv/timer.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2021 Genode Labs GmbH + * Copyright (C) 2021-2022 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. @@ -39,8 +39,7 @@ time_t Board::Timer::stime() const void Timer::_start_one_shot(time_t const ticks) { - _device.last_time = _device.stime(); - Sbi::set_timer(_device.last_time + ticks); + Sbi::set_timer(_time + ticks); } @@ -58,7 +57,7 @@ time_t Timer::_max_value() const { time_t Timer::_duration() const { - return _device.stime() - _device.last_time; + return _device.stime() - _time; } diff --git a/repos/base-hw/src/core/spec/riscv/timer.h b/repos/base-hw/src/core/spec/riscv/timer.h index 04138565cd..a1d30a1d90 100644 --- a/repos/base-hw/src/core/spec/riscv/timer.h +++ b/repos/base-hw/src/core/spec/riscv/timer.h @@ -31,8 +31,6 @@ struct Board::Timer TICKS_PER_US = TICKS_PER_MS / 1000, }; - Kernel::time_t last_time { 0 }; - Kernel::time_t stime() const; Timer(unsigned);