mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 01:08:55 +00:00
timeout: use uint64_t for all plain time values
This enforces the use of unsigned 64-bit values for time in the duration type, the timeout framework, the timer session, the userland timer-drivers, and the alarm framework on all platforms. The commit also adapts the code that uses these tools accross all basic repositories (base, base-*, os. gems, libports, ports, dde_*) to use unsigned 64-bit values for time as well as far as this does not imply profound modifications. Fixes #3208
This commit is contained in:
committed by
Christian Helmuth
parent
e072ee480b
commit
181c78d482
@ -69,12 +69,12 @@ class Lx_kit::Scheduler : public Lx::Scheduler
|
||||
|
||||
struct Logger : Genode::Thread
|
||||
{
|
||||
Timer::Connection _timer;
|
||||
Lx::Scheduler &_scheduler;
|
||||
unsigned const _interval;
|
||||
Timer::Connection _timer;
|
||||
Lx::Scheduler &_scheduler;
|
||||
Genode::uint64_t const _interval;
|
||||
|
||||
Logger(Genode::Env &env, Lx::Scheduler &scheduler,
|
||||
unsigned interval_seconds)
|
||||
Genode::uint64_t interval_seconds)
|
||||
:
|
||||
Genode::Thread(env, "logger", 0x4000),
|
||||
_timer(env), _scheduler(scheduler),
|
||||
|
@ -114,8 +114,8 @@ class Lx_kit::Timer : public Lx::Timer
|
||||
return;
|
||||
|
||||
/* calculate relative microseconds for trigger */
|
||||
unsigned long us = ctx->timeout > _jiffies ?
|
||||
jiffies_to_msecs(ctx->timeout - _jiffies) * 1000 : 0;
|
||||
Genode::uint64_t us = ctx->timeout > _jiffies ?
|
||||
(Genode::uint64_t)jiffies_to_msecs(ctx->timeout - _jiffies) * 1000 : 0;
|
||||
_timer_conn.trigger_once(us);
|
||||
}
|
||||
|
||||
@ -290,10 +290,10 @@ class Lx_kit::Timer : public Lx::Timer
|
||||
* Do not use lx_emul usecs_to_jiffies(unsigned int) because
|
||||
* of implicit truncation!
|
||||
*/
|
||||
_jiffies = _timer_conn_modern.curr_time().trunc_to_plain_ms().value / JIFFIES_TICK_MS;
|
||||
_jiffies = (Genode::uint64_t)_timer_conn_modern.curr_time().trunc_to_plain_ms().value / JIFFIES_TICK_MS;
|
||||
}
|
||||
|
||||
void usleep(unsigned us) {
|
||||
void usleep(Genode::uint64_t us) {
|
||||
_timer_conn.usleep(us); }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user