mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 12:16:31 +00:00
feat(bitmap): Add bit and for AllocBitMap (#793)
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use core::ops::BitAnd;
|
||||
|
||||
use bitmap::{traits::BitMapOps, AllocBitmap};
|
||||
|
||||
use crate::{mm::percpu::PerCpu, smp::cpu::ProcessorId};
|
||||
@ -86,6 +88,15 @@ impl CpuMask {
|
||||
}
|
||||
}
|
||||
|
||||
impl BitAnd for CpuMask {
|
||||
type Output = Self;
|
||||
|
||||
fn bitand(self, rhs: Self) -> Self::Output {
|
||||
let bmp = self.bmp & rhs.bmp;
|
||||
Self { bmp }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct CpuMaskIter<'a> {
|
||||
mask: &'a CpuMask,
|
||||
index: Option<ProcessorId>,
|
||||
|
Reference in New Issue
Block a user