Handle VmSpace's multi-CPU activation

This commit is contained in:
Zhang Junyang
2024-08-22 17:26:03 +08:00
committed by Tate, Hongliang Tian
parent cf4aee0061
commit e04fa6c69d
2 changed files with 55 additions and 4 deletions

View File

@ -156,6 +156,11 @@ impl CpuSet {
self.bitset.get(cpu_id as usize).as_deref() == Some(&true)
}
/// Returns the number of CPUs in the set.
pub fn count(&self) -> usize {
self.bitset.count_ones()
}
/// Iterates over the CPUs in the set.
pub fn iter(&self) -> IterOnes<'_, usize, Lsb0> {
self.bitset.iter_ones()