timer: remove usage of deprecated env()

Issue #2280.
This commit is contained in:
Josef Söntgen 2017-02-13 19:32:35 +01:00 committed by Christian Helmuth
parent de401f37fb
commit 0b9272bd9c
12 changed files with 40 additions and 40 deletions

View File

@ -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<Fiasco::l4_kernel_info_t>();

View File

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

View File

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

View File

@ -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<Session_component>
public:
Root_component(Genode::Entrypoint &ep, Genode::Allocator &md_alloc)
Root_component(Genode::Env &env, Genode::Allocator &md_alloc)
:
Genode::Root_component<Session_component>(&ep.rpc_ep(), &md_alloc),
_time_source(ep), _timeout_scheduler(_time_source)
Genode::Root_component<Session_component>(&env.ep().rpc_ep(), &md_alloc),
_time_source(env), _timeout_scheduler(_time_source)
{ }
};

View File

@ -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 <base/env.h>
#include <os/time_source.h>
#include <base/rpc_client.h>
#include <base/entrypoint.h>
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)
{ }
};

View File

@ -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 <base/entrypoint.h>
#include <base/env.h>
#include <base/rpc_client.h>
#include <os/time_source.h>
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<STACK_SIZE>
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<STACK_SIZE>("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) {

View File

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

View File

@ -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<Nova::Hip>();
_tsc_khz = hip->tsc_freq;
start();

View File

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

View File

@ -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(); }
/*************************

View File

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

View File

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