diff --git a/repos/dde_linux/src/lib/usb/include/signal.h b/repos/dde_linux/src/lib/usb/include/signal.h index fb70b166ac..aa36bde63c 100644 --- a/repos/dde_linux/src/lib/usb/include/signal.h +++ b/repos/dde_linux/src/lib/usb/include/signal.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2013 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. @@ -38,6 +38,8 @@ class Signal_helper Genode::Signal_transmitter &sender() { return _sender; } Genode::Parent &parent() { return _env.parent(); } Genode::Env &env() { return _env; } + Genode::Ram_session &ram() { return _env.ram(); } + Genode::Region_map &rm() { return _env.rm(); } }; diff --git a/repos/dde_linux/src/lib/usb/storage/storage.cc b/repos/dde_linux/src/lib/usb/storage/storage.cc index 7d0020c821..f6a3ffd93f 100644 --- a/repos/dde_linux/src/lib/usb/storage/storage.cc +++ b/repos/dde_linux/src/lib/usb/storage/storage.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2013 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. @@ -138,8 +138,8 @@ class Storage_device : public Genode::List::Element, public: - Storage_device(struct scsi_device *sdev) - : Block::Driver(), _sdev(sdev) + Storage_device(Genode::Ram_session &ram, struct scsi_device *sdev) + : Block::Driver(ram), _sdev(sdev) { /* read device capacity */ _capacity(); @@ -186,7 +186,8 @@ struct Factory : Block::Driver_factory { Storage_device device; - Factory(struct scsi_device *sdev) : device(sdev) {} + Factory(Genode::Ram_session &ram, struct scsi_device *sdev) + : device(ram, sdev) {} Block::Driver *create() { return &device; } void destroy(Block::Driver *driver) { } @@ -215,7 +216,7 @@ void scsi_add_device(struct scsi_device *sdev) using namespace Genode; static bool announce = false; - static struct Factory factory(sdev); + static struct Factory factory(_signal->ram(), sdev); device = &factory.device; /* @@ -223,7 +224,8 @@ void scsi_add_device(struct scsi_device *sdev) */ if (!announce) { PREPARE_WORK(&delayed, ack_packet); - static Block::Root root(_signal->ep(), Lx::Malloc::mem(), factory); + static Block::Root root(_signal->ep(), Lx::Malloc::mem(), + _signal->rm(), factory); _signal->parent().announce(_signal->ep().rpc_ep().manage(&root)); announce = true; } diff --git a/repos/dde_rump/src/server/rump_cgd/block_driver.h b/repos/dde_rump/src/server/rump_cgd/block_driver.h index 703282e69a..f39b8bf499 100644 --- a/repos/dde_rump/src/server/rump_cgd/block_driver.h +++ b/repos/dde_rump/src/server/rump_cgd/block_driver.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2014 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. @@ -37,8 +37,9 @@ class Driver : public Block::Driver public: - Driver(Server::Entrypoint &ep) + Driver(Server::Entrypoint &ep, Genode::Ram_session &ram) : + Block::Driver(ram), _blk_sz(0), _blk_cnt(0), _cgd_device(0) { try { diff --git a/repos/dde_rump/src/server/rump_cgd/main.cc b/repos/dde_rump/src/server/rump_cgd/main.cc index 171d28952b..d540c82ed4 100644 --- a/repos/dde_rump/src/server/rump_cgd/main.cc +++ b/repos/dde_rump/src/server/rump_cgd/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2014 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. @@ -27,21 +27,22 @@ struct Main struct Factory : Block::Driver_factory { - Genode::Entrypoint &ep; - Genode::Heap &heap; + Genode::Entrypoint &ep; + Genode::Ram_session &ram; + Genode::Heap &heap; - Factory(Genode::Entrypoint &ep, Genode::Heap &heap) - : ep(ep), heap(heap) { } + Factory(Genode::Entrypoint &ep, Genode::Ram_session &ram, Genode::Heap &heap) + : ep(ep), ram(ram), heap(heap) { } Block::Driver *create() { - return new (&heap) Driver(ep); } + return new (&heap) Driver(ep, ram); } void destroy(Block::Driver *driver) { Genode::destroy(&heap, driver); } - } factory { env.ep(), heap }; + } factory { env.ep(), env.ram(), heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Genode::Env &env) : env(env) { env.parent().announce(env.ep().manage(root)); } diff --git a/repos/gems/src/server/http_blk/main.cc b/repos/gems/src/server/http_blk/main.cc index 2aa0e5899b..2a56a7d8d9 100644 --- a/repos/gems/src/server/http_blk/main.cc +++ b/repos/gems/src/server/http_blk/main.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2010-2013 Genode Labs GmbH + * Copyright (C) 2010-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,8 +32,10 @@ class Driver : public Block::Driver public: - Driver(Heap &heap, size_t block_size, ::String &uri) - : _block_size(block_size), _http(heap, uri) {} + Driver(Heap &heap, Ram_session &ram, + size_t block_size, ::String &uri) + : Block::Driver(ram), + _block_size(block_size), _http(heap, uri) {} /******************************* @@ -88,7 +90,7 @@ class Factory : public Block::Driver_factory } Block::Driver *create() { - return new (&_heap) Driver(_heap, _blk_sz, _uri); } + return new (&_heap) Driver(_heap, _env.ram(), _blk_sz, _uri); } void destroy(Block::Driver *driver) { Genode::destroy(&_heap, driver); } @@ -100,7 +102,7 @@ struct Main Env &env; Heap heap { env.ram(), env.rm() }; Factory factory { env, heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Env &env) : env(env) { env.parent().announce(env.ep().manage(root)); } diff --git a/repos/os/include/block/component.h b/repos/os/include/block/component.h index 79335d9402..a677929874 100644 --- a/repos/os/include/block/component.h +++ b/repos/os/include/block/component.h @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2011-2016 Genode Labs GmbH + * Copyright (C) 2011-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. @@ -177,9 +177,10 @@ class Block::Session_component : public Block::Session_component_base, */ Session_component(Driver_factory &driver_factory, Genode::Entrypoint &ep, + Genode::Region_map &rm, size_t buf_size) : Session_component_base(driver_factory, buf_size), - Driver_session(_rq_ds, ep.rpc_ep()), + Driver_session(rm, _rq_ds, ep.rpc_ep()), _rq_phys(Dataspace_client(_rq_ds).phys_addr()), _sink_ack(ep, *this, &Session_component::_signal), _sink_submit(ep, *this, &Session_component::_signal), @@ -250,6 +251,7 @@ class Block::Root : public Genode::Root_componentram_session()->alloc(size); } + return _ram_session.alloc(size); } /** * Free buffer which is suitable for DMA. @@ -209,7 +217,7 @@ class Block::Driver * Note: has to be overriden by DMA-capable devices */ virtual void free_dma_buffer(Genode::Ram_dataspace_capability c) { - return Genode::env()->ram_session()->free(c); } + return _ram_session.free(c); } /** * Synchronize with device. diff --git a/repos/os/src/drivers/ahci/ahci.cc b/repos/os/src/drivers/ahci/ahci.cc index 95a461abd3..912c2db478 100644 --- a/repos/os/src/drivers/ahci/ahci.cc +++ b/repos/os/src/drivers/ahci/ahci.cc @@ -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. @@ -69,7 +69,7 @@ struct Ahci hba.init(); /* search for devices */ - scan_ports(env.rm()); + scan_ports(env.rm(), env.ram()); } bool atapi(unsigned sig) @@ -114,7 +114,7 @@ struct Ahci log("64-bit support: ", hba.supports_64bit() ? "yes" : "no"); } - void scan_ports(Genode::Region_map &rm) + void scan_ports(Genode::Region_map &rm, Genode::Ram_session &ram) { Genode::log("number of ports: ", hba.port_count(), " " "pi: ", Genode::Hex(hba.read())); @@ -150,13 +150,13 @@ struct Ahci switch (sig) { case ATA_SIG: - ports[i] = new (&alloc) Ata_driver(alloc, port, root, + ports[i] = new (&alloc) Ata_driver(alloc, port, ram, root, ready_count); break; case ATAPI_SIG: case ATAPI_SIG_QEMU: - ports[i] = new (&alloc) Atapi_driver(port, root, + ports[i] = new (&alloc) Atapi_driver(port, ram, root, ready_count); break; diff --git a/repos/os/src/drivers/ahci/ahci.h b/repos/os/src/drivers/ahci/ahci.h index 17b669c295..c711f851ab 100644 --- a/repos/os/src/drivers/ahci/ahci.h +++ b/repos/os/src/drivers/ahci/ahci.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. @@ -796,9 +796,10 @@ struct Port_driver : Port, Block::Driver Ahci_root &root; unsigned &sem; - Port_driver(Port &port, Ahci_root &root, unsigned &sem) - : Port(port), root(root), sem(sem) { - sem++; } + Port_driver(Port &port, Genode::Ram_session &ram, Ahci_root &root, + unsigned &sem) + : Port(port), Block::Driver(ram), + root(root), sem(sem) { sem++; } virtual void handle_irq() = 0; diff --git a/repos/os/src/drivers/ahci/ata_driver.h b/repos/os/src/drivers/ahci/ata_driver.h index 57129b4722..453eb5f891 100644 --- a/repos/os/src/drivers/ahci/ata_driver.h +++ b/repos/os/src/drivers/ahci/ata_driver.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. @@ -189,8 +189,9 @@ struct Ata_driver : Port_driver Block::Packet_descriptor pending[32]; Ata_driver(Genode::Allocator &alloc, - Port &port, Ahci_root &root, unsigned &sem) - : Port_driver(port, root, sem), alloc(alloc) + Port &port, Genode::Ram_session &ram, + Ahci_root &root, unsigned &sem) + : Port_driver(port, ram, root, sem), alloc(alloc) { Port::init(); identify_device(); diff --git a/repos/os/src/drivers/ahci/atapi_driver.h b/repos/os/src/drivers/ahci/atapi_driver.h index f792a91649..4312a1a185 100644 --- a/repos/os/src/drivers/ahci/atapi_driver.h +++ b/repos/os/src/drivers/ahci/atapi_driver.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. @@ -24,8 +24,8 @@ struct Atapi_driver : Port_driver unsigned sense_tries = 0; Block::Packet_descriptor pending; - Atapi_driver(Port &port, Ahci_root &root, unsigned &sem) - : Port_driver(port, root, sem) + Atapi_driver(Port &port, Genode::Ram_session &ram, Ahci_root &root, unsigned &sem) + : Port_driver(port, ram, root, sem) { Port::init(); Port::write(1); diff --git a/repos/os/src/drivers/ahci/main.cc b/repos/os/src/drivers/ahci/main.cc index 5843953704..b2c53e951c 100644 --- a/repos/os/src/drivers/ahci/main.cc +++ b/repos/os/src/drivers/ahci/main.cc @@ -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. @@ -55,8 +55,9 @@ class Session_component : public Block::Session_component Session_component(Block::Driver_factory &driver_factory, Genode::Entrypoint &ep, + Genode::Region_map &rm, Genode::size_t buf_size) - : Block::Session_component(driver_factory, ep, buf_size) { } + : Block::Session_component(driver_factory, ep, rm, buf_size) { } Block::Driver_factory &factory() { return _driver_factory; } }; @@ -137,7 +138,7 @@ class Block::Root_multiple_clients : public Root_component< ::Session_component> Block::Factory *factory = new (&_alloc) Block::Factory(num); ::Session_component *session = new (&_alloc) - ::Session_component(*factory, _env.ep(), tx_buf_size); + ::Session_component(*factory, _env.ep(), _env.rm(), tx_buf_size); log("session opened at device ", num, " for '", label, "'"); return session; } diff --git a/repos/os/src/drivers/sd_card/driver_base.h b/repos/os/src/drivers/sd_card/driver_base.h index a846427e13..9aa047e2e4 100644 --- a/repos/os/src/drivers/sd_card/driver_base.h +++ b/repos/os/src/drivers/sd_card/driver_base.h @@ -30,6 +30,9 @@ class Sd_card::Driver_base : public Block::Driver, { public: + Driver_base(Genode::Ram_session &ram) + : Block::Driver(ram) { } + /******************* ** Block::Driver ** *******************/ diff --git a/repos/os/src/drivers/sd_card/main.cc b/repos/os/src/drivers/sd_card/main.cc index c14cfbf4dc..62a309c28a 100644 --- a/repos/os/src/drivers/sd_card/main.cc +++ b/repos/os/src/drivers/sd_card/main.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2013-2016 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. @@ -43,7 +43,7 @@ struct Main } factory { env, heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Genode::Env &env) : env(env) { diff --git a/repos/os/src/drivers/sd_card/spec/exynos5/driver.cc b/repos/os/src/drivers/sd_card/spec/exynos5/driver.cc index f99d629326..a69f33a1d3 100644 --- a/repos/os/src/drivers/sd_card/spec/exynos5/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/exynos5/driver.cc @@ -19,7 +19,10 @@ using namespace Genode; using namespace Sd_card; -Driver::Driver(Env &env) : Attached_mmio(MSH_BASE, MSH_SIZE), _env(env) +Driver::Driver(Env &env) +: + Driver_base(env.ram()), + Attached_mmio(MSH_BASE, MSH_SIZE), _env(env) { _irq.sigh(_irq_handler); _irq.ack_irq(); diff --git a/repos/os/src/drivers/sd_card/spec/imx/driver.cc b/repos/os/src/drivers/sd_card/spec/imx/driver.cc index 5c4e8c0a6c..fa7f67e753 100644 --- a/repos/os/src/drivers/sd_card/spec/imx/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/imx/driver.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2015-2016 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. @@ -235,6 +235,7 @@ void Driver::write_dma(Block::sector_t blk_nr, Driver::Driver(Env &env) : + Driver_base(env.ram()), Attached_mmio(Board_base::SDHC_MMIO_BASE, Board_base::SDHC_MMIO_SIZE), _env(env) { diff --git a/repos/os/src/drivers/sd_card/spec/omap4/driver.cc b/repos/os/src/drivers/sd_card/spec/omap4/driver.cc index 4a1d4fc287..ea1bce3934 100644 --- a/repos/os/src/drivers/sd_card/spec/omap4/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/omap4/driver.cc @@ -372,6 +372,7 @@ Csd Driver::_read_csd() Driver::Driver(Env &env) : + Driver_base(env.ram()), Attached_mmio(MMCHS1_MMIO_BASE, MMCHS1_MMIO_SIZE), _ep(env.ep()) { _irq.sigh(_irq_handler); diff --git a/repos/os/src/drivers/sd_card/spec/pl180/driver.cc b/repos/os/src/drivers/sd_card/spec/pl180/driver.cc index 73f758469a..a9aca19ad1 100644 --- a/repos/os/src/drivers/sd_card/spec/pl180/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/pl180/driver.cc @@ -138,7 +138,8 @@ void Driver::_write_data(unsigned length, } -Driver::Driver(Env &env) : Attached_mmio(PL180_PHYS, PL180_SIZE), _timer(env) +Driver::Driver(Env &env) : Block::Driver(env.ram()), + Attached_mmio(PL180_PHYS, PL180_SIZE), _timer(env) { enum { POWER_UP = 2, POWER_ON = 3 }; diff --git a/repos/os/src/drivers/sd_card/spec/rpi/driver.cc b/repos/os/src/drivers/sd_card/spec/rpi/driver.cc index f9821d80d9..b00993ea16 100644 --- a/repos/os/src/drivers/sd_card/spec/rpi/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/rpi/driver.cc @@ -23,6 +23,7 @@ using namespace Sd_card; Driver::Driver(Env &env) : + Driver_base(env.ram()), Attached_mmio(Board_base::SDHCI_BASE, Board_base::SDHCI_SIZE), _ram(env.ram()) { diff --git a/repos/os/src/drivers/usb_block/main.cc b/repos/os/src/drivers/usb_block/main.cc index e5d6378616..ac8ee34aa2 100644 --- a/repos/os/src/drivers/usb_block/main.cc +++ b/repos/os/src/drivers/usb_block/main.cc @@ -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. @@ -710,6 +710,7 @@ struct Usb::Block_driver : Usb::Completion, Block_driver(Env &env, Genode::Allocator &alloc, Genode::Signal_context_capability sigh) : + Block::Driver(env.ram()), env(env), ep(env.ep()), announce_sigh(sigh), alloc(&alloc), device(&alloc, usb, ep) { @@ -817,7 +818,7 @@ struct Usb::Main }; Factory factory { env, heap, announce_dispatcher }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Env &env) : env(env) { } }; diff --git a/repos/os/src/server/blk_cache/driver.h b/repos/os/src/server/blk_cache/driver.h index 9790083a13..5f1656b288 100644 --- a/repos/os/src/server/blk_cache/driver.h +++ b/repos/os/src/server/blk_cache/driver.h @@ -334,7 +334,8 @@ class Driver : public Block::Driver * \param ep server entrypoint */ Driver(Genode::Env &env, Genode::Heap &heap) - : _env(env), + : Block::Driver(env.ram()), + _env(env), _r_slab(&heap), _alloc(&heap, CACHE_BLK_SIZE), _blk(_env, &_alloc, Block::Session::TX_QUEUE_SIZE*CACHE_BLK_SIZE), diff --git a/repos/os/src/server/blk_cache/main.cc b/repos/os/src/server/blk_cache/main.cc index 6bcf64b725..5aa1d44ece 100644 --- a/repos/os/src/server/blk_cache/main.cc +++ b/repos/os/src/server/blk_cache/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013-2016 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. @@ -70,7 +70,7 @@ struct Main Genode::Env &env; Genode::Heap heap { env.ram(), env.rm() }; Factory factory { env, heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Genode::Signal_handler
resource_dispatcher { env.ep(), *this, &Main::resource_handler }; diff --git a/repos/os/src/server/ram_blk/main.cc b/repos/os/src/server/ram_blk/main.cc index 6ce58f5f82..8a2c21a1c0 100644 --- a/repos/os/src/server/ram_blk/main.cc +++ b/repos/os/src/server/ram_blk/main.cc @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2010-2016 Genode Labs GmbH + * Copyright (C) 2010-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. @@ -72,7 +72,7 @@ class Ram_blk : public Block::Driver */ Ram_blk(Env &env, Allocator &alloc, const char *name, size_t block_size) - : + : Block::Driver(env.ram()), _env(env), _alloc(&alloc), _rom_ds(new (_alloc) Attached_rom_dataspace(_env, name)), _size(_rom_ds->size()), @@ -89,7 +89,7 @@ class Ram_blk : public Block::Driver * Construct empty RAM dataspace */ Ram_blk(Env &env, size_t size, size_t block_size) - : + : Block::Driver(env.ram()), _env(env), _size(size), _block_size(block_size), @@ -194,7 +194,7 @@ struct Main Genode::destroy(&alloc, driver); } } factory { env, heap, config_rom.xml() }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Env &env) : env(env) { diff --git a/repos/os/src/server/rom_blk/main.cc b/repos/os/src/server/rom_blk/main.cc index 66c5bff859..da9fa2e038 100644 --- a/repos/os/src/server/rom_blk/main.cc +++ b/repos/os/src/server/rom_blk/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2010-2016 Genode Labs GmbH + * Copyright (C) 2010-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. @@ -36,7 +36,8 @@ class Rom_blk : public Block::Driver using String = Genode::String<64UL>; Rom_blk(Env &env, String &name, size_t blk_sz) - : _env(env), _rom(env, name.string()), _blk_sz(blk_sz) {} + : Block::Driver(env.ram()), _env(env), _rom(env, name.string()), + _blk_sz(blk_sz) {} /**************************** @@ -116,7 +117,7 @@ struct Main Genode::destroy(&heap, driver); } } factory { env, heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Env &env) : env(env) { env.parent().announce(env.ep().manage(root)); } diff --git a/repos/os/src/test/blk/srv/main.cc b/repos/os/src/test/blk/srv/main.cc index 4420b20088..56c41e41e1 100644 --- a/repos/os/src/test/blk/srv/main.cc +++ b/repos/os/src/test/blk/srv/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013-2016 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. @@ -36,7 +36,8 @@ class Driver : public Block::Driver public: Driver(Genode::Env &env, Genode::size_t number, Genode::size_t size) - : _number(number), _size(size), + : Block::Driver(env.ram()), + _number(number), _size(size), _blk_ds(env.ram().alloc(number*size)), _blk_buf(env.rm().attach(_blk_ds)) {} @@ -123,7 +124,7 @@ struct Main void destroy(Block::Driver *driver) { } } factory { env, heap }; - Block::Root root { env.ep(), heap, factory }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Timer::Connection timer { env }; Genode::Signal_handler dispatcher { env.ep(), *factory.driver, &Driver::handler }; diff --git a/repos/os/src/test/fb_block_adapter/main.cc b/repos/os/src/test/fb_block_adapter/main.cc index 9420bed0f6..b6d1bce9b5 100644 --- a/repos/os/src/test/fb_block_adapter/main.cc +++ b/repos/os/src/test/fb_block_adapter/main.cc @@ -8,7 +8,7 @@ */ /* - * Copyright (C) 2010-2013 Genode Labs GmbH + * Copyright (C) 2010-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. @@ -33,8 +33,9 @@ class Driver : public Block::Driver public: - Driver() - : _fb_mode(_fb.mode()), + Driver(Genode::Ram_session &ram) + : Block::Driver(ram), + _fb_mode(_fb.mode()), _fb_cap(_fb.dataspace()), _fb_dsc(_fb_cap), _fb_addr(Genode::env()->rm_session()->attach(_fb_cap)), @@ -99,11 +100,13 @@ class Driver : public Block::Driver struct Factory : Block::Driver_factory { - Genode::Heap &heap; + Genode::Ram_session &ram; + Genode::Heap &heap; - Factory(Genode::Heap &heap) : heap(heap) {} + Factory(Genode::Ram_session &ram, Genode::Heap &heap) + : ram(ram), heap(heap) {} - Block::Driver *create() { return new (&heap) Driver(); } + Block::Driver *create() { return new (&heap) Driver(ram); } void destroy(Block::Driver *driver) { Genode::destroy(&heap, driver); } }; @@ -113,8 +116,8 @@ struct Main { Genode::Env &env; Genode::Heap heap { env.ram(), env.rm() }; - struct Factory factory { heap }; - Block::Root root { env.ep(), heap, factory }; + struct Factory factory { env.ram(), heap }; + Block::Root root { env.ep(), heap, env.rm(), factory }; Main(Genode::Env &env) : env(env) { env.parent().announce(env.ep().manage(root)); }