Remove unused and deduplicate identical arch specific consts

This commit is contained in:
bjorn3
2026-04-02 19:31:39 +02:00
parent 10b1ae2ecc
commit 980f1c6af8
7 changed files with 11 additions and 37 deletions
+2 -2
View File
@@ -29,9 +29,9 @@ unsafe impl GlobalAlloc for Allocator {
super::map_heap(
&mut KernelMapper::lock_rw(),
crate::KERNEL_HEAP_OFFSET + size,
crate::KERNEL_HEAP_SIZE,
super::KERNEL_HEAP_SIZE,
);
heap.extend(crate::KERNEL_HEAP_SIZE);
heap.extend(super::KERNEL_HEAP_SIZE);
}
}
}
+4 -1
View File
@@ -7,6 +7,9 @@ use rmm::{Flusher, FrameAllocator};
pub use self::linked_list::Allocator;
mod linked_list;
/// Size of kernel heap
const KERNEL_HEAP_SIZE: usize = ::rmm::MEGABYTE;
unsafe fn map_heap(mapper: &mut KernelMapper<true>, offset: usize, size: usize) {
let mut flush_all = PageFlushAll::new();
@@ -37,7 +40,7 @@ unsafe fn map_heap(mapper: &mut KernelMapper<true>, offset: usize, size: usize)
pub unsafe fn init() {
unsafe {
let offset = crate::KERNEL_HEAP_OFFSET;
let size = crate::KERNEL_HEAP_SIZE;
let size = KERNEL_HEAP_SIZE;
// Map heap pages
map_heap(&mut KernelMapper::lock_rw(), offset, size);