From 5351ccf03820155a2b866fa8fde0d3024d3b4ae6 Mon Sep 17 00:00:00 2001 From: Mark Poliakov Date: Fri, 15 Sep 2023 00:09:26 +0300 Subject: [PATCH] x86-64: fix some loop {}s --- src/arch/x86_64/mem/mod.rs | 16 +++++++++------- src/arch/x86_64/mod.rs | 9 ++++++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/arch/x86_64/mem/mod.rs b/src/arch/x86_64/mem/mod.rs index 177bf25d..7aabcd9c 100644 --- a/src/arch/x86_64/mem/mod.rs +++ b/src/arch/x86_64/mem/mod.rs @@ -15,7 +15,7 @@ use crate::{ mem::{ address::{FromRaw, IntoRaw, KernelImageObject}, device::RawDeviceMemoryMapping, - table::{EntryLevel, KernelAddressSpace, MapAttributes}, + table::EntryLevel, PhysicalAddress, KERNEL_VIRT_OFFSET, }, }; @@ -96,12 +96,12 @@ unsafe fn map_early_pages(physical: PhysicalAddress, count: usize) -> Result= EARLY_MAPPING_OFFSET + L2::SIZE { - loop {} + panic!("Tried to unmap invalid early mapping: {:#x}", address); } let l3i = L3::index(address - EARLY_MAPPING_OFFSET); @@ -135,7 +135,8 @@ unsafe fn map_device_memory_l3(base: PhysicalAddress, count: usize) -> Result Result { @@ -159,7 +160,8 @@ unsafe fn map_device_memory_l2(base: PhysicalAddress, count: usize) -> Result::into_raw(memory_end) + (1 << 30) - 1) >> 30; if end_l1i > 512 { - loop {} + todo!( + "Cannot handle {}GiB of RAM", + end_l1i * L1::SIZE / (1024 * 1024 * 1024) + ); } MEMORY_LIMIT.init(memory_end.into_raw()); @@ -196,7 +199,7 @@ impl Architecture for X86_64 { Ok(()) } else { - loop {} + todo!(); } } @@ -235,7 +238,7 @@ impl Architecture for X86_64 { impl X86_64 { unsafe fn handle_ipi(&self, msg: CpuMessage) { - loop {} + todo!() } fn set_boot_data(&self, data: BootData) {