Skip to content

Commit 3f2fb2c

Browse files
kernel: update the limine crate
Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 20ad092 commit 3f2fb2c

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

src/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/aero_kernel/src/arch/x86_64/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ use limine::*;
4848

4949
use self::interrupts::INTERRUPT_CONTROLLER;
5050

51-
static MEMMAP: LimineMemmapRequest = LimineMemmapRequest::new(0);
52-
static SMP: LimineSmpRequest = LimineSmpRequest::new(0);
53-
static KERNEL_FILE: LimineKernelFileRequest = LimineKernelFileRequest::new(0);
54-
static MODULES: LimineModuleRequest = LimineModuleRequest::new(0);
55-
static FRAMEBUFFER: LimineFramebufferRequest = LimineFramebufferRequest::new(0);
56-
static RSDP: LimineRsdpRequest = LimineRsdpRequest::new(0);
57-
static BOOT_TIME: LimineBootTimeRequest = LimineBootTimeRequest::new(0);
58-
static STACK: LimineStackSizeRequest = LimineStackSizeRequest::new(0).stack_size(0x1000 * 32); // 16KiB of stack for both the BSP and the APs
59-
static HHDM: LimineHhdmRequest = LimineHhdmRequest::new(0);
51+
static MEMMAP: MemmapRequest = MemmapRequest::new(0);
52+
static SMP: SmpRequest = SmpRequest::new(0);
53+
static KERNEL_FILE: KernelFileRequest = KernelFileRequest::new(0);
54+
static MODULES: ModuleRequest = ModuleRequest::new(0);
55+
static FRAMEBUFFER: FramebufferRequest = FramebufferRequest::new(0);
56+
static RSDP: RsdpRequest = RsdpRequest::new(0);
57+
static BOOT_TIME: BootTimeRequest = BootTimeRequest::new(0);
58+
static STACK: StackSizeRequest = StackSizeRequest::new(0).stack_size(0x1000 * 32); // 16KiB of stack for both the BSP and the APs
59+
static HHDM: HhdmRequest = HhdmRequest::new(0);
6060

6161
#[no_mangle]
6262
extern "C" fn arch_aero_main() -> ! {
@@ -203,7 +203,7 @@ extern "C" fn arch_aero_main() -> ! {
203203
}
204204

205205
#[no_mangle]
206-
extern "C" fn x86_64_aero_ap_main(boot_info: *const LimineSmpInfo) -> ! {
206+
extern "C" fn x86_64_aero_ap_main(boot_info: *const SmpInfo) -> ! {
207207
let boot_info = unsafe { &*boot_info };
208208
let ap_id = boot_info.processor_id as usize;
209209

src/aero_kernel/src/cmdline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::num::ParseIntError;
22

3-
use limine::{LimineFile, NonNullPtr};
3+
use limine::NonNullPtr;
44
use spin::Once;
55

66
use crate::rendy;
@@ -27,7 +27,7 @@ impl CommandLine {
2727
}
2828
}
2929

30-
fn resolve_module(modules: &[NonNullPtr<LimineFile>], name: &str) -> &'static [u8] {
30+
fn resolve_module(modules: &[NonNullPtr<limine::File>], name: &str) -> &'static [u8] {
3131
modules
3232
.iter()
3333
.find(|m| {
@@ -55,7 +55,7 @@ fn parse_number(mut string: &str) -> Result<usize, ParseIntError> {
5555
}
5656
}
5757

58-
pub fn parse(cmdline: &'static str, modules: &[NonNullPtr<LimineFile>]) -> CommandLine {
58+
pub fn parse(cmdline: &'static str, modules: &[NonNullPtr<limine::File>]) -> CommandLine {
5959
RAW_CMDLINE_STR.call_once(|| cmdline);
6060

6161
// Chew up the leading spaces.

src/aero_kernel/src/mem/paging/frame.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use core::ptr::NonNull;
2222
use core::sync::atomic::{AtomicUsize, Ordering};
2323

2424
use alloc::vec::Vec;
25-
use limine::{LimineMemmapEntry, LimineMemoryMapEntryType, NonNullPtr};
25+
use limine::{MemmapEntry, MemoryMapEntryType, NonNullPtr};
2626
use spin::Once;
2727

2828
use super::mapper::*;
@@ -74,7 +74,7 @@ impl LockedFrameAllocator {
7474
}
7575

7676
/// Initializes the inner locked global frame allocator.
77-
pub(super) fn init(&self, memory_map: &mut [NonNullPtr<LimineMemmapEntry>]) {
77+
pub(super) fn init(&self, memory_map: &mut [NonNullPtr<MemmapEntry>]) {
7878
self.0
7979
.call_once(|| Mutex::new(GlobalFrameAllocator::new(memory_map)));
8080
}
@@ -129,7 +129,7 @@ unsafe impl FrameAllocator<Size2MiB> for LockedFrameAllocator {
129129
}
130130

131131
struct RangeMemoryIter<'a> {
132-
iter: core::slice::Iter<'a, NonNullPtr<LimineMemmapEntry>>,
132+
iter: core::slice::Iter<'a, NonNullPtr<MemmapEntry>>,
133133

134134
cursor_base: PhysAddr,
135135
cursor_end: PhysAddr,
@@ -145,7 +145,7 @@ impl<'a> Iterator for RangeMemoryIter<'a> {
145145
// the memory map and set the cursor to the start of it.
146146
let next = self.iter.next()?;
147147

148-
if next.typ == LimineMemoryMapEntryType::Usable {
148+
if next.typ == MemoryMapEntryType::Usable {
149149
break Some(next);
150150
}
151151
} {
@@ -290,7 +290,7 @@ pub struct GlobalFrameAllocator {
290290
}
291291

292292
impl GlobalFrameAllocator {
293-
fn new(memory_map: &mut [NonNullPtr<LimineMemmapEntry>]) -> Self {
293+
fn new(memory_map: &mut [NonNullPtr<MemmapEntry>]) -> Self {
294294
// Find a memory map entry that is big enough to fit all of the items in
295295
// range memory iter.
296296
let requested_size = (core::mem::size_of::<MemoryRange>() * memory_map.len()) as u64;
@@ -300,7 +300,7 @@ impl GlobalFrameAllocator {
300300
let entry = &mut memory_map[i];
301301

302302
// Make sure that the memory map entry is marked as usable.
303-
if entry.typ != LimineMemoryMapEntryType::Usable {
303+
if entry.typ != MemoryMapEntryType::Usable {
304304
continue;
305305
}
306306

src/aero_kernel/src/mem/paging/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub use self::mapper::*;
3030
pub use self::page::*;
3131
pub use self::page_table::*;
3232

33-
use limine::LimineMemmapEntry;
33+
use limine::MemmapEntry;
3434
use limine::NonNullPtr;
3535

3636
pub use frame::LockedFrameAllocator;
@@ -81,7 +81,7 @@ pub const fn level_5_paging_enabled() -> bool {
8181

8282
/// Initialize paging.
8383
pub fn init(
84-
memory_regions: &mut [NonNullPtr<LimineMemmapEntry>],
84+
memory_regions: &mut [NonNullPtr<MemmapEntry>],
8585
) -> Result<OffsetPageTable<'static>, MapToError<Size4KiB>> {
8686
let active_level_4 = unsafe { active_level_4_table() };
8787
let offset_table = unsafe { OffsetPageTable::new(active_level_4, PHYSICAL_MEMORY_OFFSET) };

src/aero_kernel/src/rendy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::u8;
2424

2525
use alloc::boxed::Box;
2626

27-
use limine::LimineFramebuffer;
27+
use limine::Framebuffer;
2828
use spin::Once;
2929

3030
use crate::cmdline::CommandLine;
@@ -823,8 +823,8 @@ pub fn reset_default() {
823823
set_text_color(DEFAULT_TEXT_FOREGROUND, DEFAULT_TEXT_BACKGROUND)
824824
}
825825

826-
/// Returns the terminal's resolution in the form of a `(horizontal_resolution, vertical_resolution)`
827-
/// tuple.
826+
/// Returns the terminal's resolution in the form of a `(horizontal_resolution,
827+
/// vertical_resolution)` tuple.
828828
///
829829
/// # Panics
830830
/// This function was called before the terminal was initialized.
@@ -936,7 +936,7 @@ pub unsafe fn force_unlock() {
936936
DEBUG_RENDY.get().map(|l| l.force_unlock());
937937
}
938938

939-
pub fn init(framebuffer_tag: &LimineFramebuffer, cmdline: &CommandLine) {
939+
pub fn init(framebuffer_tag: &Framebuffer, cmdline: &CommandLine) {
940940
let framebuffer_info = RendyInfo {
941941
byte_len: framebuffer_tag.size(),
942942
bits_per_pixel: framebuffer_tag.bpp as usize,

0 commit comments

Comments
 (0)