genode/repos/libports/src/lib/acpica/env.cc
Norman Feske b44f0554bd Adapt high-level components to new parent API
This patch adjusts the various users of the 'Child' API to the changes
on the account of the new non-blocking parent interface. It also removes
the use of the no-longer-available 'Connection::KEEP_OPEN' feature.

With the adjustment, we took the opportunity to redesign several
components to fit the non-blocking execution model much better, in
particular the demo applications.

Issue #2120
2016-11-30 13:37:03 +01:00

61 lines
1.4 KiB
C++

/*
* \brief Genode environment for ACPICA library
* \author Christian Helmuth
* \date 2016-11-14
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* Genode includes */
#include <util/volatile_object.h>
#include <acpica/acpica.h>
#include <platform_session/client.h>
#include "env.h"
namespace Acpica { struct Env; }
struct Acpica::Env
{
Genode::Env &env;
Genode::Allocator &heap;
Genode::Parent::Service_name announce_for_acpica { "Acpi" };
Genode::Parent::Client parent_client;
Genode::Id_space<Genode::Parent::Client>::Element id_space_element {
parent_client, env.id_space() };
Genode::Capability<Platform::Session> cap {
Genode::reinterpret_cap_cast<Platform::Session>(
env.session(announce_for_acpica,
id_space_element.id(),
"ram_quota=24K", Genode::Affinity())) };
Platform::Client platform { cap };
Env(Genode::Env &env, Genode::Allocator &heap)
: env(env), heap(heap) { }
};
static Genode::Lazy_volatile_object<Acpica::Env> instance;
Genode::Allocator & Acpica::heap() { return instance->heap; }
Genode::Env & Acpica::env() { return instance->env; }
Platform::Client & Acpica::platform() { return instance->platform; }
void Acpica::init(Genode::Env &env, Genode::Allocator &heap)
{
instance.construct(env, heap);
}