Skip to content

Commit 00d7a99

Browse files
committed
Replace BootInfo::p4_table_addr with RECURSIVE_LEVEL_4_TABLE_ADDR constant
1 parent 6688294 commit 00d7a99

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/bootinfo/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ mod memory_map;
99
#[derive(Debug)]
1010
#[repr(C)]
1111
pub struct BootInfo {
12-
pub p4_table_addr: u64,
1312
pub memory_map: MemoryMap,
1413
pub package: Package,
1514
}
@@ -29,9 +28,8 @@ impl Deref for Package {
2928
}
3029

3130
impl BootInfo {
32-
pub fn new(p4_table_addr: u64, memory_map: MemoryMap, package: &'static [u8]) -> Self {
31+
pub fn new(memory_map: MemoryMap, package: &'static [u8]) -> Self {
3332
BootInfo {
34-
p4_table_addr,
3533
memory_map,
3634
package: Package {
3735
ptr: package.as_ptr(),

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![no_std]
22

3+
/// The virtual address of the recursively mapped level 4 page table.
4+
#[cfg(feature = "recursive_level_4_table")]
5+
pub const RECURSIVE_LEVEL_4_TABLE_ADDR: u64 = 0o_177777_777_777_777_777_0000;
6+
37
pub mod bootinfo;
48

59
/// Defines the entry point function.

src/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,7 @@ fn load_elf(
223223
};
224224

225225
// Construct boot info structure.
226-
let mut boot_info = BootInfo::new(
227-
recursive_page_table_addr.start_address().as_u64(),
228-
memory_map,
229-
&[],
230-
);
226+
let mut boot_info = BootInfo::new(memory_map, &[]);
231227
boot_info.memory_map.sort();
232228

233229
// Write boot info to boot info page.

0 commit comments

Comments
 (0)