From a6266dc385f392476fd6eaa515992ec3146a7100 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Fri, 26 Feb 2021 01:37:55 +0200 Subject: [PATCH] Make boot info compile --- nucleus/src/boot_info.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nucleus/src/boot_info.rs b/nucleus/src/boot_info.rs index 7777bc0..fc54e05 100644 --- a/nucleus/src/boot_info.rs +++ b/nucleus/src/boot_info.rs @@ -1,3 +1,5 @@ +use crate::{memory::PhysAddr, println, sync}; + #[derive(Default, Copy, Clone)] struct BootInfoMemRegion { pub start: PhysAddr, @@ -71,13 +73,13 @@ impl BootInfo { let mut new_reg: BootInfoMemRegion = BootInfoMemRegion::new(); /* Determine whether placing the region at the start or the end will create a bigger left over region */ - if reg_iter.start.align_up(1u64 << size_bits) - reg_iter.start - < reg_iter.end - reg_iter.end.align_down(1u64 << size_bits) + if reg_iter.start.aligned_up(1u64 << size_bits) - reg_iter.start + < reg_iter.end - reg_iter.end.aligned_down(1u64 << size_bits) { - new_reg.start = reg_iter.start.align_up(1u64 << size_bits); + new_reg.start = reg_iter.start.aligned_up(1u64 << size_bits); new_reg.end = new_reg.start + (1u64 << size_bits); } else { - new_reg.end = reg_iter.end.align_down(1u64 << size_bits); + new_reg.end = reg_iter.end.aligned_down(1u64 << size_bits); new_reg.start = new_reg.end - (1u64 << size_bits); } if new_reg.end > new_reg.start