diff --git a/repos/dde_bsd/src/lib/audio/bsd.h b/repos/dde_bsd/src/lib/audio/bsd.h index 4239e999ec..e5d20764a5 100644 --- a/repos/dde_bsd/src/lib/audio/bsd.h +++ b/repos/dde_bsd/src/lib/audio/bsd.h @@ -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 * 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 irq_init(Genode::Entrypoint&, Genode::Allocator&); - void timer_init(Genode::Entrypoint&); + void timer_init(Genode::Env&); void update_time(); diff --git a/repos/dde_bsd/src/lib/audio/bus.cc b/repos/dde_bsd/src/lib/audio/bus.cc index 8609fdbd7a..d914d494e4 100644 --- a/repos/dde_bsd/src/lib/audio/bus.cc +++ b/repos/dde_bsd/src/lib/audio/bus.cc @@ -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 * 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 }; - Platform::Connection _pci; + Platform::Connection _pci { _env }; Platform::Device_capability _cap; Genode::Io_port_connection *_io_port { nullptr }; diff --git a/repos/dde_bsd/src/lib/audio/driver.cc b/repos/dde_bsd/src/lib/audio/driver.cc index 17a65761a2..a5b9ab3bdb 100644 --- a/repos/dde_bsd/src/lib/audio/driver.cc +++ b/repos/dde_bsd/src/lib/audio/driver.cc @@ -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 * 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::irq_init(env.ep(), alloc); - Bsd::timer_init(env.ep()); + Bsd::timer_init(env); static Task_args args(env, alloc, config); diff --git a/repos/dde_bsd/src/lib/audio/mem.cc b/repos/dde_bsd/src/lib/audio/mem.cc index 6ff5d132e9..e085dcd6a9 100644 --- a/repos/dde_bsd/src/lib/audio/mem.cc +++ b/repos/dde_bsd/src/lib/audio/mem.cc @@ -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 * under the terms of the GNU General Public License version 2. @@ -81,9 +81,10 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator, public: - Slab_backend_alloc(Genode::Ram_session &ram, Genode::Region_map &rm, - Genode::Allocator &md_alloc) + Slab_backend_alloc(Genode::Env &env, Genode::Ram_session &ram, + Genode::Region_map &rm, Genode::Allocator &md_alloc) : + Rm_connection(env), Region_map_client(Rm_connection::create(VM_SIZE)), _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) { - 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); _malloc = &m; } diff --git a/repos/dde_bsd/src/lib/audio/timer.cc b/repos/dde_bsd/src/lib/audio/timer.cc index 33d2686d93..3aea6f54a6 100644 --- a/repos/dde_bsd/src/lib/audio/timer.cc +++ b/repos/dde_bsd/src/lib/audio/timer.cc @@ -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 * under the terms of the GNU General Public License version 2. @@ -55,9 +55,10 @@ class Bsd::Timer /** * 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); } @@ -69,16 +70,21 @@ class Bsd::Timer { millisecs = _timer_conn.elapsed_ms(); } + + void delay(unsigned ms) + { + _timer_conn.msleep(ms); + } }; 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? */ - static Bsd::Timer bsd_timer(ep); + static Bsd::Timer bsd_timer(env); _bsd_timer = &bsd_timer; /* initialize value explicitly */ @@ -90,9 +96,6 @@ void Bsd::update_time() { _bsd_timer->update_millisecs(); } -static Timer::Connection _timer; - - static Bsd::Task *_sleep_task; @@ -128,5 +131,5 @@ extern "C" void wakeup(const volatile void *ident) extern "C" void delay(int delay) { - _timer.msleep(delay); + _bsd_timer->delay(delay); }