Function cpu_num

Source
pub fn cpu_num() -> usize
Expand description

Gets the number of CPUs running in the system.

When SMP is disabled, this function always returns 1.

When SMP is enabled, it’s the smaller one between the platform-declared CPU number [axplat::power::cpu_num] and the configured maximum CPU number axconfig::plat::MAX_CPU_NUM.

This value is determined during the BSP initialization phase.