Remove unused and deduplicate identical arch specific consts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user