diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-09-01 19:59:44 -0500 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-09-01 19:59:44 -0500 |
commit | 386df39c9866a4d945de46ef0dcab2363c674e0e (patch) | |
tree | c0572ce6a2c81c93546210f599dff553783c5760 /kernel/src/allocators/mod.rs | |
parent | 6b98b6afea6e790abe738a67aa28bab54c91afe0 (diff) |
Move almost all the kernel into crates/.
Diffstat (limited to 'kernel/src/allocators/mod.rs')
-rw-r--r-- | kernel/src/allocators/mod.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/kernel/src/allocators/mod.rs b/kernel/src/allocators/mod.rs deleted file mode 100644 index 49f29e2..0000000 --- a/kernel/src/allocators/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -use core::{ffi::c_void, ops::Range, ptr::addr_of}; - -pub mod buddy; -pub mod physical_memory_free_list; - -/// The number of bits in the offset in a page. -pub const PAGE_SIZE_BITS: usize = 12; - -/// The size of a page, in bytes. -pub const PAGE_SIZE: usize = 1 << PAGE_SIZE_BITS; - -/// Returns the physical address range the kernel is in. -pub fn kernel_boundaries() -> Range<usize> { - extern "C" { - static kernel_start: c_void; - static kernel_end: c_void; - } - - // SAFETY: We only use these as addresses, we never dereference them. - let (kernel_start_addr, kernel_end_addr) = - unsafe { (addr_of!(kernel_start), addr_of!(kernel_end)) }; - - kernel_start_addr as usize..kernel_end_addr as usize -} |