diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-04-17 23:59:03 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:16:34 +0200 |
| commit | 43d2363b0bf16df6932db54fff28089207f8e2b4 (patch) | |
| tree | a00b6aa39ace1b44892b223457dd96561d679696 /src/mm | |
| parent | 6e5e38e7f21ea5a69ac0ac538584841df9f6b13f (diff) | |
formatting code
Diffstat (limited to 'src/mm')
| -rw-r--r-- | src/mm/pma.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mm/pma.rs b/src/mm/pma.rs index af789e8..f9a6811 100644 --- a/src/mm/pma.rs +++ b/src/mm/pma.rs @@ -15,8 +15,8 @@ pub struct FMap { pub skip_byte: usize, } -pub enum PMAError{ - DoubleFree +pub enum PMAError { + DoubleFree, } impl FMap { @@ -34,25 +34,25 @@ impl FMap { /// return : index to the bitmap u8 , bit mask to retrive the bit. fn locate_bit(addr: usize) -> Option<(usize, u8)> { if addr >= Mem::PHY_TOP { - return None + return None; } let pn = addr >> Mem::PAGE_SHIFT; let idx = pn / 8; - let mask:u8 = 1 << (pn % 8); + let mask: u8 = 1 << (pn % 8); Some((idx, mask)) } pub fn alloc_frame(&mut self) -> usize { for i in self.skip_byte..self.bm.len() { if self.bm[i] == 0xff { - continue + continue; } todo!() } 0 } - pub fn dealloc_frame(&mut self) -> Result<(),PMAError>{ + pub fn dealloc_frame(&mut self) -> Result<(), PMAError> { Ok(()) } |
