From 43d2363b0bf16df6932db54fff28089207f8e2b4 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 17 Apr 2024 23:59:03 +0200 Subject: formatting code --- src/mm/pma.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mm') 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(()) } -- cgit v1.2.3-70-g09d2