class Graph

Defined at line 55 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

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 40 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 30 of file ../../zircon/kernel/lib/topology/system-topology.cc

void Dump ()

Defined at line 44 of file ../../zircon/kernel/lib/topology/system-topology.cc

void Graph ()

Graph instances are default constructible to empty.

Defined at line 81 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h

void ~Graph ()

Defined at line 83 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h

void Graph (const Graph & )

Graph instances are neither copyable nor movable.

Defined at line 90 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h

Graph & operator= (const Graph & )

Defined at line 91 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h

void Graph (Graph && )

Defined at line 92 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h

Graph & operator= (Graph && )

Defined at line 93 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 96 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 100 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 104 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 108 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 119 of file ../../zircon/kernel/lib/topology/include/lib/system-topology.h