aboutsummaryrefslogtreecommitdiff
path: root/src/mm/pma.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm/pma.rs')
-rw-r--r--src/mm/pma.rs12
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(())
}