diff --git a/repos/libports/run/acpica.run b/repos/libports/run/acpica.run index 2e5bde8056..1845f93775 100644 --- a/repos/libports/run/acpica.run +++ b/repos/libports/run/acpica.run @@ -40,7 +40,7 @@ proc platform_drv_add_routing {} { # override default config to react on 'system' ROM changes for reset proc platform_drv_config_config {} { return { - } + } } append_platform_drv_build_components diff --git a/repos/os/src/drivers/platform/spec/x86/README b/repos/os/src/drivers/platform/spec/x86/README index 7f4fd53af6..e9a7edfe7a 100644 --- a/repos/os/src/drivers/platform/spec/x86/README +++ b/repos/os/src/drivers/platform/spec/x86/README @@ -119,24 +119,32 @@ configured to not wait for the acpi report: Synchronize ACPI startup and platform driver -------------------------------------------- -If the config attribute 'system' is set to 'yes', the platform driver monitors -a ROM in XML format named 'system'. +If the config attribute 'acpi_ready' is set to 'yes', the platform driver +monitors a ROM in XML format named 'acpi_ready'. ! -! +! + +The platform driver will announce its service not as 'Platform', but instead +as 'Acpi' first. -Additionally, the platform driver will announce the service as 'Acpi' first. An ACPI application like acpica can connect to the platform driver and may reconfigure hardware devices according to the ACPI table findings. If the system state changes to "acpi_ready in the XML ROM 'acpi_ready': ! -the platform driver will announce the platform session, so that drivers may -start to operate with the platform driver. +the platform driver will announce the platform session as 'Platform', so +that drivers may start to operate with the platform driver. Hardware reset -------------- +If the config attribute 'system' is set to 'yes', the platform driver monitors +a ROM in XML format named 'system'. + +! +! + If the attribute 'state' in the system XML ROM turns to 'reset' ! diff --git a/repos/os/src/drivers/platform/spec/x86/main.cc b/repos/os/src/drivers/platform/spec/x86/main.cc index afc6c3ddc6..833dc714e1 100644 --- a/repos/os/src/drivers/platform/spec/x86/main.cc +++ b/repos/os/src/drivers/platform/spec/x86/main.cc @@ -47,7 +47,7 @@ struct Platform::Main Genode::Capability > root_cap; - bool _system_rom = false; + bool _acpi_ready = false; void acpi_update() { @@ -62,7 +62,7 @@ struct Platform::Main root_cap = _env.ep().manage(*root); - if (_system_rom) { + if (_acpi_ready) { Genode::Parent::Service_name announce_for_acpi("Acpi"); _env.parent().announce(announce_for_acpi, root_cap); } else @@ -71,17 +71,16 @@ struct Platform::Main void system_update() { - if (!_system_rom || !system_state.is_constructed() || - !acpi_ready.is_constructed()) - return; + if (system_state.is_constructed()) + system_state->update(); - system_state->update(); - acpi_ready->update(); + if (acpi_ready.is_constructed()) + acpi_ready->update(); if (!root.is_constructed()) return; - if (system_state->is_valid()) { + if (system_state.is_constructed() && system_state->is_valid()) { Genode::Xml_node system(system_state->local_addr(), system_state->size()); @@ -91,7 +90,8 @@ struct Platform::Main if (state == "reset") root->system_reset(); } - if (acpi_ready->is_valid()) { + + if (acpi_ready.is_constructed() && acpi_ready->is_valid()) { Genode::Xml_node system(acpi_ready->local_addr(), acpi_ready->size()); @@ -112,21 +112,22 @@ struct Platform::Main _system_report(_env.ep(), *this, &Main::system_update) { const Genode::Xml_node config = _config.xml(); + bool const system_rom = config.attribute_value("system", false); + bool const wait_for_acpi = config.attribute_value("acpi", true); + _acpi_ready = config.attribute_value("acpi_ready", false); - _system_rom = config.attribute_value("system", false); - - typedef Genode::String<8> Value; - Value const wait_for_acpi = config.attribute_value("acpi", Value("yes")); - - if (_system_rom) { + if (system_rom) { /* wait for system state changes, e.g. reset and acpi_ready */ system_state.construct(env, "system"); system_state->sigh(_system_report); + } + + if (_acpi_ready) { acpi_ready.construct(env, "acpi_ready"); acpi_ready->sigh(_system_report); } - if (wait_for_acpi == "yes") { + if (wait_for_acpi) { /* for ACPI support, wait for the first valid acpi report */ acpi_rom.construct(env, "acpi"); acpi_rom->sigh(_acpi_report);