/* * \brief Topology session interface * \author Michael Müller * \date 2022-10-06 * * A topology session stores the component's view on the hardware topology, i.e. it's location within the NUMA topology. */ /* * Copyright (C) 2022 Michael Müller * * This file is part of EalánOS which is based on the Genode OS framework * released under the terms of the GNU Affero General Public License version 3. */ #pragma once #include #include #include namespace Genode { struct Topo_connection; } struct Genode::Topo_connection : Connection, Topo_session_client { enum { RAM_QUOTA = 2097152UL }; Topo_connection(Env &env, const char *label = "", Affinity const &affinity = Affinity()) : Connection(env, session(env.parent(), affinity, "ram_quota=%u, cap_quota=%u, label=\"%s\"", RAM_QUOTA, CAP_QUOTA, label)), Topo_session_client(cap()) {} Topology::Numa_region node_affinity_of(Affinity::Location const &loc) override { return Topo_session_client::node_affinity_of(loc); } Topology::Numa_region node_at_id(unsigned node_id) override { return Topo_session_client::node_at_id(node_id); } unsigned node_count() override { return Topo_session_client::node_count(); } };