From 15821e32ec67c8ca27aada6f74fa31b580290c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Mon, 13 Feb 2017 20:51:27 +0100 Subject: [PATCH] nic: remove usage of deprecated env() This commit includes changes to the Nic::Session_component interface. We now pass the entire env to the component instead of only ram, rm and the ep because we need the env to open connections from within the Session_component implemenation. So far only the cadence_gem driver needs this, though. Issue #2280. --- repos/dde_ipxe/src/drivers/nic/main.cc | 7 +--- .../src/lib/usb/include/usb_nic_component.h | 11 ++---- repos/dde_linux/src/lib/wifi/nic.cc | 11 ++---- repos/libports/run/lwip.run | 5 +-- repos/os/include/nic/component.h | 20 +++++----- repos/os/include/nic/root.h | 5 +-- .../drivers/nic/spec/gem/buffer_descriptor.h | 7 ++-- .../os/src/drivers/nic/spec/gem/cadence_gem.h | 17 ++++----- repos/os/src/drivers/nic/spec/gem/main.cc | 37 +++++++++++-------- .../os/src/drivers/nic/spec/gem/marvell_phy.h | 8 ++-- .../nic/spec/gem/rx_buffer_descriptor.h | 4 +- .../src/drivers/nic/spec/gem/system_control.h | 13 ++++--- .../nic/spec/gem/tx_buffer_descriptor.h | 7 ++-- .../os/src/drivers/nic/spec/lan9118/lan9118.h | 3 +- repos/os/src/drivers/nic/spec/linux/main.cc | 24 +++++++----- .../os/src/drivers/platform/spec/imx53/ccm.h | 2 +- .../os/src/drivers/platform/spec/imx53/iim.h | 2 +- .../src/drivers/platform/spec/imx53/iomux.h | 2 +- .../src/drivers/platform/spec/imx53/main.cc | 2 +- .../os/src/drivers/platform/spec/imx53/src.h | 2 +- .../src/drivers/platform/spec/odroid_x2/cmu.h | 2 +- .../drivers/platform/spec/odroid_x2/main.cc | 2 +- .../src/drivers/platform/spec/odroid_x2/pmu.h | 2 +- .../os/src/drivers/platform/spec/rpi/main.cc | 2 +- repos/os/src/drivers/platform/spec/rpi/mbox.h | 2 +- repos/os/src/server/nic_loopback/main.cc | 24 +++++------- repos/ports/src/app/openvpn/main.cc | 14 +++---- repos/ports/src/app/openvpn/tun_genode.cc | 2 - 28 files changed, 112 insertions(+), 127 deletions(-) diff --git a/repos/dde_ipxe/src/drivers/nic/main.cc b/repos/dde_ipxe/src/drivers/nic/main.cc index 8e84bf79ce..6ee21c66b6 100644 --- a/repos/dde_ipxe/src/drivers/nic/main.cc +++ b/repos/dde_ipxe/src/drivers/nic/main.cc @@ -101,11 +101,8 @@ class Ipxe_session_component : public Nic::Session_component Ipxe_session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Genode::Entrypoint &ep) - : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep) + Genode::Env &env) + : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env) { instance = this; diff --git a/repos/dde_linux/src/lib/usb/include/usb_nic_component.h b/repos/dde_linux/src/lib/usb/include/usb_nic_component.h index bad7ac0a98..c375a6357e 100644 --- a/repos/dde_linux/src/lib/usb/include/usb_nic_component.h +++ b/repos/dde_linux/src/lib/usb/include/usb_nic_component.h @@ -179,12 +179,9 @@ class Usb_nic::Session_component : public Nic::Session_component Session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Genode::Entrypoint &ep, + Genode::Env &env, Device *device) - : Nic::Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep), + : Nic::Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env), _device(device) { _device->session(this); } @@ -258,9 +255,7 @@ class Root : public Root_component return new (Root::md_alloc()) Usb_nic::Session_component(tx_buf_size, rx_buf_size, - Lx::Malloc::mem(), - _env.ram(), _env.rm(), - _env.ep(), _device); + Lx::Malloc::mem(), _env, _device); } public: diff --git a/repos/dde_linux/src/lib/wifi/nic.cc b/repos/dde_linux/src/lib/wifi/nic.cc index d3a070d346..ed7d0822ca 100644 --- a/repos/dde_linux/src/lib/wifi/nic.cc +++ b/repos/dde_linux/src/lib/wifi/nic.cc @@ -90,11 +90,8 @@ class Wifi_session_component : public Nic::Session_component Wifi_session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Genode::Entrypoint &ep, net_device *ndev) - : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep), + Genode::Env &env, net_device *ndev) + : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env), _ndev(ndev) { _ndev->lx_nic_device = this; @@ -198,9 +195,7 @@ class Root : public Genode::Root_component - - - + + } diff --git a/repos/os/include/nic/component.h b/repos/os/include/nic/component.h index 47fcb527c9..3c8dc1f7ad 100644 --- a/repos/os/include/nic/component.h +++ b/repos/os/include/nic/component.h @@ -16,7 +16,7 @@ #define _INCLUDE__NIC__COMPONENT_H_ #include -#include +#include #include #include @@ -84,24 +84,22 @@ class Nic::Session_component : Communication_buffers, public Session_rpc_object * \param rx_buf_size buffer size for rx channel * \param rx_block_md_alloc backing store of the meta data of the * rx block allocator - * \param ram_session RAM session to allocate tx and rx buffers - * \param ep entry point used for packet stream - * channels + * \param env Genode environment needed to access + * resources and open connections from + * within the Session_component */ Session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Genode::Entrypoint &ep) + Genode::Env &env) : - Communication_buffers(rx_block_md_alloc, ram_session, region_map, + Communication_buffers(rx_block_md_alloc, env.ram(), env.rm(), tx_buf_size, rx_buf_size), - Session_rpc_object(region_map, + Session_rpc_object(env.rm(), _tx_ds.cap(), _rx_ds.cap(), - &_rx_packet_alloc, ep.rpc_ep()), - _ep(ep) + &_rx_packet_alloc, env.ep().rpc_ep()), + _ep(env.ep()) { /* install data-flow signal handlers for both packet streams */ _tx.sigh_ready_to_ack(_packet_stream_dispatcher); diff --git a/repos/os/include/nic/root.h b/repos/os/include/nic/root.h index 8b12766050..dd149ad3da 100644 --- a/repos/os/include/nic/root.h +++ b/repos/os/include/nic/root.h @@ -61,10 +61,7 @@ class Nic::Root : public Genode::Root_componentram_session(), BUFFER_SIZE * buffer_count, UNCACHED), + Buffer_descriptor(Genode::Env &env, const size_t buffer_count = 1) + : + Attached_ram_dataspace(env.ram(), env.rm(), BUFFER_SIZE * buffer_count, UNCACHED), Genode::Mmio( reinterpret_cast(local_addr()) ), _buffer_count(buffer_count), _buffer_offset(BUFFER_DESC_SIZE * buffer_count), diff --git a/repos/os/src/drivers/nic/spec/gem/cadence_gem.h b/repos/os/src/drivers/nic/spec/gem/cadence_gem.h index 9e00a2b316..a8ab946952 100644 --- a/repos/os/src/drivers/nic/spec/gem/cadence_gem.h +++ b/repos/os/src/drivers/nic/spec/gem/cadence_gem.h @@ -459,17 +459,16 @@ namespace Genode Cadence_gem(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Server::Entrypoint &ep, + Genode::Env &env, addr_t const base, size_t const size, const int irq) : - Genode::Attached_mmio(base, size), - Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep), - _irq(irq), - _irq_handler(ep, *this, &Cadence_gem::_handle_irq), - _phy(*this) + Genode::Attached_mmio(env, base, size), + Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env), + _timer(env), + _sys_ctrl(env, _timer), _tx_buffer(env, _timer), _rx_buffer(env), + _irq(env, irq), + _irq_handler(env.ep(), *this, &Cadence_gem::_handle_irq), + _phy(*this, _timer) { _irq.sigh(_irq_handler); _irq.ack_irq(); diff --git a/repos/os/src/drivers/nic/spec/gem/main.cc b/repos/os/src/drivers/nic/spec/gem/main.cc index 3698f0c50c..da2b270ab1 100644 --- a/repos/os/src/drivers/nic/spec/gem/main.cc +++ b/repos/os/src/drivers/nic/spec/gem/main.cc @@ -12,15 +12,19 @@ */ /* Genode includes */ +/* + * Needs to be included first because otherwise + * util/xml_node.h will not pick up the ascii_to + * overload. + */ +#include + +#include #include #include -#include #include -#include #include -#include - #include "cadence_gem.h" namespace Server { @@ -30,29 +34,30 @@ namespace Server { struct Main; } -class Server::Gem_session_component -: - public Cadence_gem +class Server::Gem_session_component : public Cadence_gem { + private: + + Genode::Attached_rom_dataspace _config_rom; + public: + Gem_session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Server::Entrypoint &ep) + Genode::Env &env) : - Cadence_gem(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep, + Cadence_gem(tx_buf_size, rx_buf_size, rx_block_md_alloc, env, Board_base::EMAC_0_MMIO_BASE, Board_base::EMAC_0_MMIO_SIZE, - Board_base::EMAC_0_IRQ) + Board_base::EMAC_0_IRQ), + _config_rom(env, "config") { Nic::Mac_address mac_addr; /* try using configured MAC address */ try { - Genode::Xml_node nic_config = Genode::config()->xml_node().sub_node("nic"); + Genode::Xml_node nic_config = _config_rom.xml().sub_node("nic"); nic_config.attribute("mac").value(&mac_addr); Genode::log("Using configured MAC address ", mac_addr); } catch (...) { @@ -76,7 +81,7 @@ struct Server::Main Env &_env; Heap _heap { _env.ram(), _env.rm() }; - Nic::Root nic_root{ _env, *Genode::env()->heap() }; + Nic::Root nic_root{ _env, _heap }; Main(Env &env) : _env(env) { @@ -84,5 +89,5 @@ struct Server::Main } }; -void Component::construct(Genode::Env &env) { static Server::Main main(env); } +void Component::construct(Genode::Env &env) { static Server::Main main(env); } diff --git a/repos/os/src/drivers/nic/spec/gem/marvell_phy.h b/repos/os/src/drivers/nic/spec/gem/marvell_phy.h index 551c10ec83..23edb7b036 100644 --- a/repos/os/src/drivers/nic/spec/gem/marvell_phy.h +++ b/repos/os/src/drivers/nic/spec/gem/marvell_phy.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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. @@ -162,7 +162,7 @@ namespace Genode PHY_AUTONEGOTIATE_TIMEOUT = 5000 }; - Timer::Connection _timer; + Timer::Connection &_timer; Phyio& _phyio; int8_t _phyaddr; bool _link_up; @@ -551,7 +551,9 @@ namespace Genode public: - Marvel_phy(Phyio& phyio) : + Marvel_phy(Phyio& phyio, Timer::Connection &timer) + : + _timer(timer), _phyio(phyio), _phyaddr(0), _link_up(false), diff --git a/repos/os/src/drivers/nic/spec/gem/rx_buffer_descriptor.h b/repos/os/src/drivers/nic/spec/gem/rx_buffer_descriptor.h index 590aeffa13..06868ee889 100644 --- a/repos/os/src/drivers/nic/spec/gem/rx_buffer_descriptor.h +++ b/repos/os/src/drivers/nic/spec/gem/rx_buffer_descriptor.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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,7 +52,7 @@ class Rx_buffer_descriptor : public Buffer_descriptor public: - Rx_buffer_descriptor() : Buffer_descriptor(BUFFER_COUNT) + Rx_buffer_descriptor(Genode::Env &env) : Buffer_descriptor(env, BUFFER_COUNT) { /* * mark the last buffer descriptor diff --git a/repos/os/src/drivers/nic/spec/gem/system_control.h b/repos/os/src/drivers/nic/spec/gem/system_control.h index 001bdc225b..de25e738b9 100644 --- a/repos/os/src/drivers/nic/spec/gem/system_control.h +++ b/repos/os/src/drivers/nic/spec/gem/system_control.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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. @@ -108,9 +108,13 @@ class System_control : private Genode::Attached_mmio unsigned int old_data[0x300]; + + Timer::Connection &_timer; + public: - System_control() : - Attached_mmio(Board_base::MMIO_1_BASE, 0xB80) + System_control(Genode::Env &env, Timer::Connection &timer) : + Attached_mmio(env, Board_base::MMIO_1_BASE, 0xB80), + _timer(timer) { Lock_guard lock(*this); @@ -143,8 +147,7 @@ class System_control : private Genode::Attached_mmio write(clk); write(rclk); - static Timer::Connection timer; - timer.msleep(100); + _timer.msleep(100); } }; diff --git a/repos/os/src/drivers/nic/spec/gem/tx_buffer_descriptor.h b/repos/os/src/drivers/nic/spec/gem/tx_buffer_descriptor.h index b2401e7b06..11296bf359 100644 --- a/repos/os/src/drivers/nic/spec/gem/tx_buffer_descriptor.h +++ b/repos/os/src/drivers/nic/spec/gem/tx_buffer_descriptor.h @@ -37,9 +37,11 @@ class Tx_buffer_descriptor : public Buffer_descriptor class Package_send_timeout : public Genode::Exception {}; + Timer::Connection &_timer; public: - Tx_buffer_descriptor() : Buffer_descriptor(BUFFER_COUNT) + Tx_buffer_descriptor(Genode::Env &env, Timer::Connection &timer) + : Buffer_descriptor(env, BUFFER_COUNT), _timer(timer) { for (unsigned int i=0; i()), _timer(env), diff --git a/repos/os/src/drivers/nic/spec/linux/main.cc b/repos/os/src/drivers/nic/spec/linux/main.cc index 9125860308..8d62eb2dc5 100644 --- a/repos/os/src/drivers/nic/spec/linux/main.cc +++ b/repos/os/src/drivers/nic/spec/linux/main.cc @@ -24,13 +24,19 @@ */ /* Genode */ +/* + * Needs to be included first because otherwise + * util/xml_node.h will not pick up the ascii_to + * overload. + */ +#include + +#include #include #include #include #include #include -#include -#include /* Linux */ #include @@ -76,6 +82,8 @@ class Linux_session_component : public Nic::Session_component } }; + Genode::Attached_rom_dataspace _config_rom; + Nic::Mac_address _mac_addr; int _tap_fd; Rx_signal_thread _rx_thread; @@ -104,7 +112,7 @@ class Linux_session_component : public Nic::Session_component /* get tap device from config */ try { - Genode::Xml_node nic_node = Genode::config()->xml_node().sub_node("nic"); + Genode::Xml_node nic_node = _config_rom.xml().sub_node("nic"); nic_node.attribute("tap").value(ifr.ifr_name, sizeof(ifr.ifr_name)); Genode::log("using tap device \"", Genode::Cstring(ifr.ifr_name), "\""); } catch (...) { @@ -198,17 +206,15 @@ class Linux_session_component : public Nic::Session_component Linux_session_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Server::Entrypoint &ep) + Server::Env &env) : - Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep), + Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env), + _config_rom(env, "config"), _tap_fd(_setup_tap_fd()), _rx_thread(_tap_fd, _packet_stream_dispatcher) { /* try using configured MAC address */ try { - Genode::Xml_node nic_config = Genode::config()->xml_node().sub_node("nic"); + Genode::Xml_node nic_config = _config_rom.xml().sub_node("nic"); nic_config.attribute("mac").value(&_mac_addr); Genode::log("Using configured MAC address ", _mac_addr); } catch (...) { diff --git a/repos/os/src/drivers/platform/spec/imx53/ccm.h b/repos/os/src/drivers/platform/spec/imx53/ccm.h index 49165439d7..d36647b634 100644 --- a/repos/os/src/drivers/platform/spec/imx53/ccm.h +++ b/repos/os/src/drivers/platform/spec/imx53/ccm.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/imx53/iim.h b/repos/os/src/drivers/platform/spec/imx53/iim.h index 7266d179f0..23c521037c 100644 --- a/repos/os/src/drivers/platform/spec/imx53/iim.h +++ b/repos/os/src/drivers/platform/spec/imx53/iim.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/imx53/iomux.h b/repos/os/src/drivers/platform/spec/imx53/iomux.h index c2298cb127..b33bdc1e8d 100644 --- a/repos/os/src/drivers/platform/spec/imx53/iomux.h +++ b/repos/os/src/drivers/platform/spec/imx53/iomux.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/imx53/main.cc b/repos/os/src/drivers/platform/spec/imx53/main.cc index bd94b6a943..9cc83ff0f6 100644 --- a/repos/os/src/drivers/platform/spec/imx53/main.cc +++ b/repos/os/src/drivers/platform/spec/imx53/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/imx53/src.h b/repos/os/src/drivers/platform/spec/imx53/src.h index eef1f3fac7..d6ef8b0508 100644 --- a/repos/os/src/drivers/platform/spec/imx53/src.h +++ b/repos/os/src/drivers/platform/spec/imx53/src.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/odroid_x2/cmu.h b/repos/os/src/drivers/platform/spec/odroid_x2/cmu.h index 4a1c8eb993..075ece911f 100644 --- a/repos/os/src/drivers/platform/spec/odroid_x2/cmu.h +++ b/repos/os/src/drivers/platform/spec/odroid_x2/cmu.h @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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. diff --git a/repos/os/src/drivers/platform/spec/odroid_x2/main.cc b/repos/os/src/drivers/platform/spec/odroid_x2/main.cc index 2471f5e476..d41124106c 100644 --- a/repos/os/src/drivers/platform/spec/odroid_x2/main.cc +++ b/repos/os/src/drivers/platform/spec/odroid_x2/main.cc @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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. diff --git a/repos/os/src/drivers/platform/spec/odroid_x2/pmu.h b/repos/os/src/drivers/platform/spec/odroid_x2/pmu.h index a26575b2e6..20d1f71e85 100644 --- a/repos/os/src/drivers/platform/spec/odroid_x2/pmu.h +++ b/repos/os/src/drivers/platform/spec/odroid_x2/pmu.h @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-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. diff --git a/repos/os/src/drivers/platform/spec/rpi/main.cc b/repos/os/src/drivers/platform/spec/rpi/main.cc index 9129be1dd3..506b7d53a5 100644 --- a/repos/os/src/drivers/platform/spec/rpi/main.cc +++ b/repos/os/src/drivers/platform/spec/rpi/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/drivers/platform/spec/rpi/mbox.h b/repos/os/src/drivers/platform/spec/rpi/mbox.h index 7245026fcc..c2e58420b1 100644 --- a/repos/os/src/drivers/platform/spec/rpi/mbox.h +++ b/repos/os/src/drivers/platform/spec/rpi/mbox.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013 Genode Labs GmbH + * Copyright (C) 2013-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. diff --git a/repos/os/src/server/nic_loopback/main.cc b/repos/os/src/server/nic_loopback/main.cc index 21c1a30621..d306356f98 100644 --- a/repos/os/src/server/nic_loopback/main.cc +++ b/repos/os/src/server/nic_loopback/main.cc @@ -48,12 +48,10 @@ class Nic_loopback::Session_component : public Nic::Session_component Session_component(size_t const tx_buf_size, size_t const rx_buf_size, Allocator &rx_block_md_alloc, - Ram_session &ram_session, - Region_map ®ion_map, - Entrypoint &ep) + Env &env) : Nic::Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep) + env) { } Nic::Mac_address mac_address() override @@ -145,9 +143,7 @@ class Nic_loopback::Root : public Root_component { private: - Entrypoint &_ep; - Ram_session &_ram; - Region_map &_rm; + Env &_env; protected: @@ -174,18 +170,16 @@ class Nic_loopback::Root : public Root_component } return new (md_alloc()) Session_component(tx_buf_size, rx_buf_size, - *md_alloc(), _ram, _rm, _ep); + *md_alloc(), _env); } public: - Root(Entrypoint &ep, - Ram_session &ram, - Region_map &rm, - Allocator &md_alloc) + Root(Env &env, + Allocator &md_alloc) : - Root_component(&ep.rpc_ep(), &md_alloc), - _ep(ep), _ram(ram), _rm(rm) + Root_component(&env.ep().rpc_ep(), &md_alloc), + _env(env) { } }; @@ -196,7 +190,7 @@ struct Nic_loopback::Main Heap _heap { _env.ram(), _env.rm() }; - Nic_loopback::Root _root { _env.ep(), _env.ram(), _env.rm(), _heap }; + Nic_loopback::Root _root { _env, _heap }; Main(Env &env) : _env(env) { diff --git a/repos/ports/src/app/openvpn/main.cc b/repos/ports/src/app/openvpn/main.cc index 711c249039..e4e0e7c3c1 100644 --- a/repos/ports/src/app/openvpn/main.cc +++ b/repos/ports/src/app/openvpn/main.cc @@ -133,11 +133,8 @@ class Openvpn_component : public Tuntap_device, Openvpn_component(Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, Genode::Allocator &rx_block_md_alloc, - Genode::Ram_session &ram_session, - Genode::Region_map ®ion_map, - Genode::Entrypoint &ep) - : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, - ram_session, region_map, ep) + Genode::Env &env) + : Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env) { char buf[] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x01 }; _mac_addr = Nic::Mac_address((void*)buf); @@ -236,10 +233,9 @@ class Root : public Genode::Root_component #include -#include #include -#include #include #include