class Graph
Defined at line 40 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
A view of the system topology that is defined in early boot and static during the run of the
system.
Public Methods
void Graph ()
Graph instances are default constructible to empty.
Defined at line 66 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
zx_status_t InitializeSystemTopology (const zbi_topology_node_t * nodes, size_t count)
Initializes the system topology Graph instance from the given flat
topology. Performs validation on the flat topology before updating the
system graph with the unflattened data. If validation fails an error is
returned the system graph is left unmodified in its original state.
Note that there is no explicit synchronization protecting concurrent
access to the system topology. It is expected to be initialized once at
early boot and then remain static and read-only. Relaxing this constraint
is possible by adding internal synchronization.
Returns ZX_ERR_NO_MEMORY if dynamic memory allocation fails.
Returns ZX_ERR_INVALID_ARGS if validation of the flat topology fails.
Defined at line 153 of file ../../zircon/kernel/lib/topology/system-topology.cc
zx_status_t Initialize (Graph * graph, const zbi_topology_node_t * nodes, size_t count)
Initializes the given topology Graph instance from the given flat
topology. Performs validation on the flat topology before updating the
|graph| with the unflattened data. If validation fails an error is
returned and |graph| is left unmodified in its original state.
Returns ZX_ERR_NO_MEMORY if dynamic memory allocation fails.
Returns ZX_ERR_INVALID_ARGS if validation of the flat topology fails.
Defined at line 67 of file ../../zircon/kernel/lib/topology/system-topology.cc
void Graph (ktl::unique_ptr<Node[]> nodes, fbl::Vector<Node *> processors, size_t logical_processor_count, fbl::Vector<Node *> processors_by_logical_id)
Constructs a Graph instance from the given unflattened topology data.
Defined at line 69 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
void Graph (const Graph & )
Graph instances are not copyable.
Defined at line 77 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
Graph & operator= (const Graph & )
Defined at line 78 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
void Graph (Graph && )
Graph instances are movable.
Defined at line 81 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
Graph & operator= (Graph && )
Defined at line 82 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
IterableProcessors processors ()
Provides iterable container of pointers to all processor nodes.
Defined at line 85 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
size_t processor_count ()
Number of processor nodes in the topology, this is equivalent to the
number of physical processor cores.
Defined at line 89 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
size_t logical_processor_count ()
Number of logical processors in system, this will be different from
processor_count() if the system supports SMT.
Defined at line 93 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
zx_status_t ProcessorByLogicalId (cpu_num_t id, Node ** processor)
Finds the processor node that is assigned the given logical id.
Sets processor to point to that node. If it wasn't found, returns ZX_ERR_NOT_FOUND.
Defined at line 97 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
const Graph & GetSystemTopology ()
Returns an immutable reference to the system topology graph. This may be
called after the graph is initialized by Graph::InitializeSystemTopology.
Defined at line 108 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h
void Dump ()
Not a fantastic dump routine, but displays everything in the tree, leaf -> root
for every leaf node.
Defined at line 253 of file ../../zircon/kernel/lib/topology/system-topology.cc