2012-02-25 21:40:23 +01:00
|
|
|
/*
|
|
|
|
* \brief Service and session interface
|
|
|
|
* \author Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
|
|
|
|
* \date 2012-02-25
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2009-2017 Genode Labs GmbH
|
2012-02-25 21:40:23 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2012-02-25 21:40:23 +01:00
|
|
|
*/
|
|
|
|
|
2016-05-28 10:52:26 +02:00
|
|
|
/* Genode includes */
|
|
|
|
#include <base/component.h>
|
|
|
|
#include <base/heap.h>
|
|
|
|
#include <base/log.h>
|
|
|
|
#include <util/xml_generator.h>
|
2012-02-25 21:40:23 +01:00
|
|
|
|
2016-05-28 10:52:26 +02:00
|
|
|
/* local includes */
|
|
|
|
#include <acpi.h>
|
2019-07-09 18:28:12 +02:00
|
|
|
#include <smbios_table_reporter.h>
|
2012-02-25 21:40:23 +01:00
|
|
|
|
|
|
|
|
2016-05-28 10:52:26 +02:00
|
|
|
namespace Acpi {
|
2012-02-25 21:40:23 +01:00
|
|
|
using namespace Genode;
|
|
|
|
|
2016-05-28 10:52:26 +02:00
|
|
|
struct Main;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Acpi::Main
|
|
|
|
{
|
2019-08-27 19:19:02 +02:00
|
|
|
Genode::Env &_env;
|
|
|
|
Genode::Heap _heap { _env.ram(), _env.rm() };
|
2016-05-28 10:52:26 +02:00
|
|
|
|
2019-08-27 19:19:02 +02:00
|
|
|
struct Acpi_reporter
|
2016-05-28 10:52:26 +02:00
|
|
|
{
|
2019-08-27 19:19:02 +02:00
|
|
|
Acpi_reporter(Env &env, Heap &heap)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Acpi::generate_report(env, heap);
|
|
|
|
} catch (Genode::Xml_generator::Buffer_exceeded) {
|
|
|
|
error("ACPI report too large - failure");
|
|
|
|
throw;
|
|
|
|
} catch (...) {
|
|
|
|
error("Unknown exception occured - failure");
|
|
|
|
throw;
|
|
|
|
}
|
2016-05-28 10:52:26 +02:00
|
|
|
}
|
2019-08-27 19:19:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Acpi_reporter _acpi_reporter { _env, _heap };
|
|
|
|
Smbios_table_reporter _smbt_reporter { _env, _heap };
|
|
|
|
|
|
|
|
Main(Env &env) : _env(env) { }
|
2016-05-28 10:52:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-11-28 15:13:14 +01:00
|
|
|
void Component::construct(Genode::Env &env) { static Acpi::Main main(env); }
|