diff --git a/framework/jinux-frame/src/arch/x86/boot/memory_region.rs b/framework/jinux-frame/src/arch/x86/boot/memory_region.rs index 304639b1b..9282cbd98 100644 --- a/framework/jinux-frame/src/arch/x86/boot/memory_region.rs +++ b/framework/jinux-frame/src/arch/x86/boot/memory_region.rs @@ -80,7 +80,7 @@ impl MemoryRegion { /// Remove range t from self, resulting in 0, 1 or 2 truncated ranges. /// We need to have this method since memory regions can overlap. - pub fn truncate(&self, t: MemoryRegion) -> Vec { + pub fn truncate(&self, t: &MemoryRegion) -> Vec { if self.base < t.base { if self.base + self.len > t.base { if self.base + self.len > t.base + t.len { diff --git a/framework/jinux-frame/src/arch/x86/boot/multiboot2/mod.rs b/framework/jinux-frame/src/arch/x86/boot/multiboot2/mod.rs index 435d48f38..74d12105d 100644 --- a/framework/jinux-frame/src/arch/x86/boot/multiboot2/mod.rs +++ b/framework/jinux-frame/src/arch/x86/boot/multiboot2/mod.rs @@ -172,7 +172,7 @@ pub fn init_memory_regions() { for &r_unusable in ®ions_unusable { regions_dst.clear(); for r_usable in &*regions_src { - regions_dst.append(&mut r_usable.truncate(r_unusable)); + regions_dst.append(&mut r_usable.truncate(&r_unusable)); } swap(regions_src, regions_dst); } @@ -182,8 +182,8 @@ pub fn init_memory_regions() { MEMORY_REGIONS.call_once(|| regions_unusable); } -/// The entry point of kernel code, which should be defined by the package that -/// uses jinux-frame. +// The entry point of kernel code, which should be defined by the package that +// uses jinux-frame. extern "Rust" { fn jinux_main() -> !; }