pub mod addr; pub mod frame; pub mod phys; pub mod refcount; pub mod typed_addr; pub mod virt; pub(crate) struct RawSlice { ptr: *mut T, len: usize, } unsafe impl Send for RawSlice {} impl RawSlice { pub const fn empty() -> Self { Self { ptr: core::ptr::null_mut(), len: 0, } } pub fn init(&mut self, ptr: *mut T, len: usize) { self.ptr = ptr; self.len = len; } pub fn as_slice(&self) -> &[T] { match self.len { 0 => &[], _ => unsafe { core::slice::from_raw_parts(self.ptr, self.len) }, } } pub fn as_slice_mut(&mut self) -> &mut [T] { match self.len { 0 => &mut [], _ => unsafe { core::slice::from_raw_parts_mut(self.ptr, self.len) }, } } pub fn len(&self) -> usize { self.len } } pub fn init(memory_map: &[&limine::memory_map::Entry], hhdm_offset: u64) { addr::set_hhdm_offset(hhdm_offset); phys::BitmapFrameAllocator::init(memory_map); refcount::init(memory_map); }