From 2380fc442f899239ce2e65d576d81ad38f09007e Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 12 Jan 2015 11:17:40 +0100 Subject: [PATCH] ahci: avoid to reinstantiate backend driver Instead of fixing the missing dynamic facilities of the AHCI driver backends for x86 and Exynos5, just avoid to create/destroy the backend for every new connection, but always use one and the same object. The AHCI drivers need to be re-written anyway, see issue #1352 for instance, we can make it more robust for the dynamic case then. Fixes #786 Fixes #1133 --- repos/os/src/drivers/ahci/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/os/src/drivers/ahci/main.cc b/repos/os/src/drivers/ahci/main.cc index 3026b05382..05e43c7ec1 100644 --- a/repos/os/src/drivers/ahci/main.cc +++ b/repos/os/src/drivers/ahci/main.cc @@ -33,10 +33,10 @@ struct Main struct Factory : Block::Driver_factory { Block::Driver *create() { - return new(env()->heap()) Ahci_driver(); } + static Ahci_driver driver; + return &driver; } - void destroy(Block::Driver *driver) { - Genode::destroy(env()->heap(), static_cast(driver)); } + void destroy(Block::Driver *driver) { } } factory; Block::Root root;