Some more clippy fixes, warnings are noisy
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#![expect(unused)]
|
||||
|
||||
use core::arch::x86_64::__cpuid;
|
||||
|
||||
use crate::arch::x86_64::memory::mapping::PHYSICAL_MEMORY_OFFSET;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![expect(unused)]
|
||||
use core::arch::x86_64::__cpuid;
|
||||
use spin::Lazy;
|
||||
use x86_64::registers::model_specific::Msr;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![allow(clippy::missing_safety_doc)]
|
||||
|
||||
use x86_64::instructions::port::Port;
|
||||
|
||||
const CMD_INIT: u8 = 0x11;
|
||||
|
||||
@@ -173,15 +173,22 @@ impl FoundryFallbackAllocator {
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialises the Foundry OS fallback allocator. This is currently a
|
||||
/// linked list allocator pulled from the linked_list_allocator crate.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// This function assumes you passed a valid `heap_start` and `heap_size`,
|
||||
/// as these are unchecked.
|
||||
pub unsafe fn init(&mut self, heap_start: usize, heap_size: usize) {
|
||||
unsafe { self.add_region(heap_start, heap_size) };
|
||||
}
|
||||
|
||||
unsafe fn add_region(&mut self, addr: usize, size: usize) {
|
||||
let mut node = FallbackListNode::new(size);
|
||||
node.next = self.head.next.take();
|
||||
let node_ptr = addr as *mut FallbackListNode;
|
||||
unsafe {
|
||||
let mut node = FallbackListNode::new(size);
|
||||
node.next = self.head.next.take();
|
||||
let node_ptr = addr as *mut FallbackListNode;
|
||||
node_ptr.write(node);
|
||||
self.head.next = Some(&mut *node_ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user