diff --git a/repos/os/src/drivers/timer/fiasco/time_source.cc b/repos/os/src/drivers/timer/fiasco/time_source.cc index 0add208797..84461d213d 100644 --- a/repos/os/src/drivers/timer/fiasco/time_source.cc +++ b/repos/os/src/drivers/timer/fiasco/time_source.cc @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2006-2013 Genode Labs GmbH + * Copyright (C) 2006-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -74,7 +74,7 @@ Microseconds Timer::Time_source::max_timeout() const Microseconds Timer::Time_source::curr_time() const { Genode::Lock::Guard lock_guard(_lock); - static Genode::Attached_rom_dataspace kip_ds("l4v2_kip"); + static Genode::Attached_rom_dataspace kip_ds(_env, "l4v2_kip"); static Fiasco::l4_kernel_info_t * const kip = kip_ds.local_addr(); diff --git a/repos/os/src/drivers/timer/hw/time_source.cc b/repos/os/src/drivers/timer/hw/time_source.cc index 2ed8751d25..f11cd988ff 100644 --- a/repos/os/src/drivers/timer/hw/time_source.cc +++ b/repos/os/src/drivers/timer/hw/time_source.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2015 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -28,9 +28,9 @@ using Microseconds = Genode::Time_source::Microseconds; enum { MIN_TIMEOUT_US = 1000 }; -Timer::Time_source::Time_source(Entrypoint &ep) +Timer::Time_source::Time_source(Env &env) : - Signalled_time_source(ep), + Signalled_time_source(env), _max_timeout_us(Kernel::timeout_max_us()) { if (_max_timeout_us < MIN_TIMEOUT_US) { diff --git a/repos/os/src/drivers/timer/hw/time_source.h b/repos/os/src/drivers/timer/hw/time_source.h index 60c554c76f..6d8526d3e1 100644 --- a/repos/os/src/drivers/timer/hw/time_source.h +++ b/repos/os/src/drivers/timer/hw/time_source.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2015 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -30,7 +30,7 @@ class Timer::Time_source : public Genode::Signalled_time_source public: - Time_source(Genode::Entrypoint &ep); + Time_source(Genode::Env &env); /************************* diff --git a/repos/os/src/drivers/timer/include/root_component.h b/repos/os/src/drivers/timer/include/root_component.h index 76c84bfe68..22cf5ec2b4 100644 --- a/repos/os/src/drivers/timer/include/root_component.h +++ b/repos/os/src/drivers/timer/include/root_component.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2006-2013 Genode Labs GmbH + * Copyright (C) 2006-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -52,10 +52,10 @@ class Timer::Root_component : public Genode::Root_component public: - Root_component(Genode::Entrypoint &ep, Genode::Allocator &md_alloc) + Root_component(Genode::Env &env, Genode::Allocator &md_alloc) : - Genode::Root_component(&ep.rpc_ep(), &md_alloc), - _time_source(ep), _timeout_scheduler(_time_source) + Genode::Root_component(&env.ep().rpc_ep(), &md_alloc), + _time_source(env), _timeout_scheduler(_time_source) { } }; diff --git a/repos/os/src/drivers/timer/include/signalled_time_source.h b/repos/os/src/drivers/timer/include/signalled_time_source.h index ecfcd044fc..64c450a0be 100644 --- a/repos/os/src/drivers/timer/include/signalled_time_source.h +++ b/repos/os/src/drivers/timer/include/signalled_time_source.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2016 Genode Labs GmbH + * Copyright (C) 2016-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -15,9 +15,9 @@ #define _SIGNALLED_TIME_SOURCE_H_ /* Genode includes */ +#include #include #include -#include namespace Genode { class Signalled_time_source; } @@ -39,9 +39,9 @@ class Genode::Signalled_time_source : public Time_source public: - Signalled_time_source(Entrypoint &ep) + Signalled_time_source(Env &env) : - _signal_handler(ep, *this, + _signal_handler(env.ep(), *this, &Signalled_time_source::_handle_timeout) { } }; diff --git a/repos/os/src/drivers/timer/include/threaded_time_source.h b/repos/os/src/drivers/timer/include/threaded_time_source.h index 36196200f7..f5fd80d457 100644 --- a/repos/os/src/drivers/timer/include/threaded_time_source.h +++ b/repos/os/src/drivers/timer/include/threaded_time_source.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2009-2015 Genode Labs GmbH + * Copyright (C) 2009-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -16,20 +16,18 @@ #define _THREADED_TIME_SOURCE_H_ /* Genode inludes */ -#include +#include #include #include namespace Timer { - enum { STACK_SIZE = 8 * 1024 * sizeof(Genode::addr_t) }; - class Threaded_time_source; } class Timer::Threaded_time_source : public Genode::Time_source, - protected Genode::Thread_deprecated + protected Genode::Thread { private: @@ -76,10 +74,10 @@ class Timer::Threaded_time_source : public Genode::Time_source, public: - Threaded_time_source(Genode::Entrypoint &ep) + Threaded_time_source(Genode::Env &env) : - Thread_deprecated("threaded_time_source"), - _irq_dispatcher_cap(ep.rpc_ep().manage(&_irq_dispatcher_component)) + Thread(env, "threaded_time_source", 8 * 1024 * sizeof(Genode::addr_t)), + _irq_dispatcher_cap(env.ep().rpc_ep().manage(&_irq_dispatcher_component)) { } void handler(Timeout_handler &handler) { diff --git a/repos/os/src/drivers/timer/main.cc b/repos/os/src/drivers/timer/main.cc index a70574964b..c59a4aa633 100644 --- a/repos/os/src/drivers/timer/main.cc +++ b/repos/os/src/drivers/timer/main.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2006-2015 Genode Labs GmbH + * Copyright (C) 2006-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -32,7 +32,7 @@ class Main public: Main(Env &env) : _sliced_heap(env.ram(), env.rm()), - _root(env.ep(), _sliced_heap) + _root(env, _sliced_heap) { env.parent().announce(env.ep().manage(_root)); } diff --git a/repos/os/src/drivers/timer/nova/time_source.cc b/repos/os/src/drivers/timer/nova/time_source.cc index 199e1644f4..04b495f13c 100644 --- a/repos/os/src/drivers/timer/nova/time_source.cc +++ b/repos/os/src/drivers/timer/nova/time_source.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -26,10 +26,10 @@ using namespace Nova; using Microseconds = Genode::Time_source::Microseconds; -Timer::Time_source::Time_source(Entrypoint &ep) : Threaded_time_source(ep) +Timer::Time_source::Time_source(Env &env) : Threaded_time_source(env) { /* read out the tsc frequenzy once */ - Attached_rom_dataspace _ds("hypervisor_info_page"); + Attached_rom_dataspace _ds(env, "hypervisor_info_page"); Nova::Hip * const hip = _ds.local_addr(); _tsc_khz = hip->tsc_freq; start(); diff --git a/repos/os/src/drivers/timer/nova/time_source.h b/repos/os/src/drivers/timer/nova/time_source.h index 3c59255d0c..f298dda6c4 100644 --- a/repos/os/src/drivers/timer/nova/time_source.h +++ b/repos/os/src/drivers/timer/nova/time_source.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -55,7 +55,7 @@ class Timer::Time_source : public Threaded_time_source public: - Time_source(Genode::Entrypoint &ep); + Time_source(Genode::Env &env); /************************* diff --git a/repos/os/src/drivers/timer/periodic/time_source.h b/repos/os/src/drivers/timer/periodic/time_source.h index 7b6ad09615..241dbd71d3 100644 --- a/repos/os/src/drivers/timer/periodic/time_source.h +++ b/repos/os/src/drivers/timer/periodic/time_source.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2009-2015 Genode Labs GmbH + * Copyright (C) 2009-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -25,6 +25,8 @@ class Timer::Time_source : public Threaded_time_source { private: + Genode::Env &_env; + Genode::Lock mutable _lock; unsigned long _curr_time_us = 0; unsigned long _next_timeout_us = max_timeout().value; @@ -40,8 +42,8 @@ class Timer::Time_source : public Threaded_time_source public: - Time_source(Genode::Entrypoint &ep) : Threaded_time_source(ep) { - start(); } + Time_source(Genode::Env &env) + : Threaded_time_source(env), _env(env) { start(); } /************************* diff --git a/repos/os/src/drivers/timer/pit/time_source.cc b/repos/os/src/drivers/timer/pit/time_source.cc index 0047d82134..48bac07f23 100644 --- a/repos/os/src/drivers/timer/pit/time_source.cc +++ b/repos/os/src/drivers/timer/pit/time_source.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2009-2015 Genode Labs GmbH + * Copyright (C) 2009-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -104,11 +104,11 @@ Microseconds Timer::Time_source::curr_time() const } -Timer::Time_source::Time_source(Entrypoint &ep) +Timer::Time_source::Time_source(Env &env) : - Signalled_time_source(ep), - _io_port(PIT_DATA_PORT_0, PIT_CMD_PORT - PIT_DATA_PORT_0 + 1), - _timer_irq(IRQ_PIT) + Signalled_time_source(env), + _io_port(env, PIT_DATA_PORT_0, PIT_CMD_PORT - PIT_DATA_PORT_0 + 1), + _timer_irq(env, IRQ_PIT) { /* operate PIT in one-shot mode */ _io_port.outb(PIT_CMD_PORT, PIT_CMD_SELECT_CHANNEL_0 | diff --git a/repos/os/src/drivers/timer/pit/time_source.h b/repos/os/src/drivers/timer/pit/time_source.h index 350b992565..8aa0b824cc 100644 --- a/repos/os/src/drivers/timer/pit/time_source.h +++ b/repos/os/src/drivers/timer/pit/time_source.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2009-2015 Genode Labs GmbH + * Copyright (C) 2009-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -74,7 +74,7 @@ class Timer::Time_source : public Genode::Signalled_time_source public: - Time_source(Genode::Entrypoint &ep); + Time_source(Genode::Env &env); /*************************