From 14f192fb005cf16e47b709184289479d1e041c62 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 11 May 2022 14:27:09 +0200 Subject: [PATCH] platform_drv: make devices ROM name configureable Fix genodelabs/genode#4504 --- repos/os/src/drivers/platform/README | 17 +++++++++++++++++ repos/os/src/drivers/platform/common.h | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/repos/os/src/drivers/platform/README b/repos/os/src/drivers/platform/README index 71e0aac21c..0caac1d721 100644 --- a/repos/os/src/drivers/platform/README +++ b/repos/os/src/drivers/platform/README @@ -1,5 +1,22 @@ This directory contains the implementation of Genode's platform driver. +Devices ROM +----------- + +The platform driver knows which devices exist, as well as what resources +they need by parsing XML information from a devices ROM. This ROM might be +a boot module written by a system integrator, or is dynamically produced +after investigating ACPI and PCI(*) information. The devices ROM name can be +defined by setting the "devices_rom" attribute in the config of the +platform driver: + +! +! ... +! + +If the attribute isn't set, the platform driver asks for a ROM called +"devices" by default. + Behavior -------- diff --git a/repos/os/src/drivers/platform/common.h b/repos/os/src/drivers/platform/common.h index 5c2a1672c3..354e63cd10 100644 --- a/repos/os/src/drivers/platform/common.h +++ b/repos/os/src/drivers/platform/common.h @@ -20,7 +20,8 @@ class Driver::Common private: Env & _env; - Attached_rom_dataspace _devices_rom { _env, "devices" }; + String<64> _rom_name; + Attached_rom_dataspace _devices_rom { _env, _rom_name.string() }; Reporter _cfg_reporter { _env, "config" }; Reporter _dev_reporter { _env, "devices" }; Heap _heap { _env.ram(), _env.rm() }; @@ -82,6 +83,8 @@ Driver::Common::Common(Genode::Env & env, Attached_rom_dataspace & config_rom) : _env(env), + _rom_name(config_rom.xml().attribute_value("devices_rom", + String<64>("devices"))), _root(_env, _sliced_heap, config_rom, _devices) { _handle_devices();