dde_bsd: remove usage of deprecated env()

Issue #2280.
This commit is contained in:
Josef Söntgen 2017-02-11 15:30:30 +01:00 committed by Christian Helmuth
parent 69925ee126
commit 7d91b1d949
5 changed files with 23 additions and 19 deletions

View File

@ -5,7 +5,7 @@
*/ */
/* /*
* Copyright (C) 2014-2016 Genode Labs GmbH * Copyright (C) 2014-2017 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -28,7 +28,7 @@ namespace Bsd {
void mem_init(Genode::Env&, Genode::Allocator &); void mem_init(Genode::Env&, Genode::Allocator &);
void irq_init(Genode::Entrypoint&, Genode::Allocator&); void irq_init(Genode::Entrypoint&, Genode::Allocator&);
void timer_init(Genode::Entrypoint&); void timer_init(Genode::Env&);
void update_time(); void update_time();

View File

@ -5,7 +5,7 @@
*/ */
/* /*
* Copyright (C) 2014-2016 Genode Labs GmbH * Copyright (C) 2014-2017 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -49,7 +49,7 @@ class Pci_driver : public Bsd::Bus_driver
struct pci_attach_args _pa { 0, 0, 0, 0, 0 }; struct pci_attach_args _pa { 0, 0, 0, 0, 0 };
Platform::Connection _pci; Platform::Connection _pci { _env };
Platform::Device_capability _cap; Platform::Device_capability _cap;
Genode::Io_port_connection *_io_port { nullptr }; Genode::Io_port_connection *_io_port { nullptr };

View File

@ -5,7 +5,7 @@
*/ */
/* /*
* Copyright (C) 2014-2016 Genode Labs GmbH * Copyright (C) 2014-2017 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -507,7 +507,7 @@ void Audio::init_driver(Genode::Env &env, Genode::Allocator &alloc,
{ {
Bsd::mem_init(env, alloc); Bsd::mem_init(env, alloc);
Bsd::irq_init(env.ep(), alloc); Bsd::irq_init(env.ep(), alloc);
Bsd::timer_init(env.ep()); Bsd::timer_init(env);
static Task_args args(env, alloc, config); static Task_args args(env, alloc, config);

View File

@ -5,7 +5,7 @@
*/ */
/* /*
* Copyright (C) 2014-2016 Genode Labs GmbH * Copyright (C) 2014-2017 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -81,9 +81,10 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
public: public:
Slab_backend_alloc(Genode::Ram_session &ram, Genode::Region_map &rm, Slab_backend_alloc(Genode::Env &env, Genode::Ram_session &ram,
Genode::Allocator &md_alloc) Genode::Region_map &rm, Genode::Allocator &md_alloc)
: :
Rm_connection(env),
Region_map_client(Rm_connection::create(VM_SIZE)), Region_map_client(Rm_connection::create(VM_SIZE)),
_index(0), _range(&md_alloc), _ram(ram) _index(0), _range(&md_alloc), _ram(ram)
{ {
@ -311,7 +312,7 @@ static Bsd::Malloc *_malloc;
void Bsd::mem_init(Genode::Env &env, Genode::Allocator &alloc) void Bsd::mem_init(Genode::Env &env, Genode::Allocator &alloc)
{ {
static Bsd::Slab_backend_alloc sb(env.ram(), env.rm(), alloc); static Bsd::Slab_backend_alloc sb(env, env.ram(), env.rm(), alloc);
static Bsd::Malloc m(sb, alloc); static Bsd::Malloc m(sb, alloc);
_malloc = &m; _malloc = &m;
} }

View File

@ -5,7 +5,7 @@
*/ */
/* /*
* Copyright (C) 2014-2016 Genode Labs GmbH * Copyright (C) 2014-2017 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -55,9 +55,10 @@ class Bsd::Timer
/** /**
* Constructor * Constructor
*/ */
Timer(Genode::Entrypoint &ep) Timer(Genode::Env &env)
: :
_dispatcher(ep, *this, &Bsd::Timer::_handle) _timer_conn(env),
_dispatcher(env.ep(), *this, &Bsd::Timer::_handle)
{ {
_timer_conn.sigh(_dispatcher); _timer_conn.sigh(_dispatcher);
} }
@ -69,16 +70,21 @@ class Bsd::Timer
{ {
millisecs = _timer_conn.elapsed_ms(); millisecs = _timer_conn.elapsed_ms();
} }
void delay(unsigned ms)
{
_timer_conn.msleep(ms);
}
}; };
static Bsd::Timer *_bsd_timer; static Bsd::Timer *_bsd_timer;
void Bsd::timer_init(Genode::Entrypoint &ep) void Bsd::timer_init(Genode::Env &env)
{ {
/* XXX safer way preventing possible nullptr access? */ /* XXX safer way preventing possible nullptr access? */
static Bsd::Timer bsd_timer(ep); static Bsd::Timer bsd_timer(env);
_bsd_timer = &bsd_timer; _bsd_timer = &bsd_timer;
/* initialize value explicitly */ /* initialize value explicitly */
@ -90,9 +96,6 @@ void Bsd::update_time() {
_bsd_timer->update_millisecs(); } _bsd_timer->update_millisecs(); }
static Timer::Connection _timer;
static Bsd::Task *_sleep_task; static Bsd::Task *_sleep_task;
@ -128,5 +131,5 @@ extern "C" void wakeup(const volatile void *ident)
extern "C" void delay(int delay) extern "C" void delay(int delay)
{ {
_timer.msleep(delay); _bsd_timer->delay(delay);
} }