mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
platform_drv: check acpi ability by platform_info
Instead of retieving the information about the underlying platform from the configuration, check the running kernel from the platform_info. This commit removes the undocumented "acpi" config attribute.
This commit is contained in:
parent
be053ed257
commit
4fa34190de
@ -175,13 +175,7 @@ proc platform_drv_config_config {} {
|
||||
<config acpi_ready="yes">}
|
||||
}
|
||||
|
||||
if {[have_spec acpi] || [have_spec arm] || [have_spec muen]} {
|
||||
return {
|
||||
<config>}
|
||||
}
|
||||
|
||||
return {
|
||||
<config acpi="no">}
|
||||
return {<config>}
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,8 @@ struct Platform::Main
|
||||
|
||||
Genode::Capability<Genode::Typed_root<Platform::Session_component> > root_cap { };
|
||||
|
||||
bool _acpi_ready = false;
|
||||
bool const _acpi_platform;
|
||||
bool _acpi_ready = false;
|
||||
|
||||
void acpi_update()
|
||||
{
|
||||
@ -57,9 +58,8 @@ struct Platform::Main
|
||||
return;
|
||||
|
||||
const char * report_addr = acpi_rom->local_addr<const char>();
|
||||
bool const acpi_platform = _config.xml().attribute_value("acpi", true);
|
||||
|
||||
root.construct(_env, sliced_heap, _config, report_addr, acpi_platform);
|
||||
root.construct(_env, sliced_heap, _config, report_addr, _acpi_platform);
|
||||
|
||||
root_cap = _env.ep().manage(*root);
|
||||
|
||||
@ -92,11 +92,27 @@ struct Platform::Main
|
||||
}
|
||||
}
|
||||
|
||||
static bool acpi_platform(Genode::Env & env)
|
||||
{
|
||||
using Name = String<32>;
|
||||
try {
|
||||
Genode::Attached_rom_dataspace info { env, "platform_info" };
|
||||
Name kernel =
|
||||
info.xml().sub_node("kernel").attribute_value("name", Name());
|
||||
if (kernel == "hw" ||
|
||||
kernel == "nova" ||
|
||||
kernel == "foc" ||
|
||||
kernel == "sel4") { return true; }
|
||||
} catch (...) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
Main(Genode::Env &env)
|
||||
:
|
||||
_env(env),
|
||||
_acpi_report(_env.ep(), *this, &Main::acpi_update),
|
||||
_system_report(_env.ep(), *this, &Main::system_update)
|
||||
_system_report(_env.ep(), *this, &Main::system_update),
|
||||
_acpi_platform(acpi_platform(env))
|
||||
{
|
||||
const Genode::Xml_node config = _config.xml();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user