mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
/*
|
|
* \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 <topo_session/client.h>
|
|
#include <topo_session/node.h>
|
|
#include <base/connection.h>
|
|
|
|
namespace Genode {
|
|
struct Topo_connection;
|
|
}
|
|
|
|
struct Genode::Topo_connection : Connection<Topo_session>, Topo_session_client
|
|
{
|
|
enum
|
|
{
|
|
RAM_QUOTA = 2097152UL
|
|
};
|
|
|
|
Topo_connection(Env &env, const char *label = "", Affinity const &affinity = Affinity())
|
|
:
|
|
Connection<Topo_session>(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();
|
|
}
|
|
}; |