hw: fix 'Kernel::time()' deviation in RISC-V timer

Issue #4360
This commit is contained in:
Christian Prochaska 2022-11-21 11:58:40 +01:00 committed by Christian Helmuth
parent 345c01677d
commit acb6bbb649
2 changed files with 3 additions and 6 deletions

View File

@ -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;
}

View File

@ -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);