Skip to content

Commit 48a1034

Browse files
committed
refactor(mm): inline physicalmem/virtualmem print_information
1 parent dc34ec0 commit 48a1034

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/mm/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use self::allocator::LockedAllocator;
1515
use crate::arch::mm::paging::HugePageSize;
1616
pub use crate::arch::mm::paging::virtual_to_physical;
1717
use crate::arch::mm::paging::{BasePageSize, LargePageSize, PageSize};
18+
use crate::mm::physicalmem::PHYSICAL_FREE_LIST;
19+
use crate::mm::virtualmem::KERNEL_FREE_LIST;
1820
use crate::{arch, env};
1921

2022
#[cfg(target_os = "none")]
@@ -241,8 +243,8 @@ pub(crate) fn init() {
241243
}
242244

243245
pub(crate) fn print_information() {
244-
self::physicalmem::print_information();
245-
self::virtualmem::print_information();
246+
info!("Physical memory free list:\n{}", PHYSICAL_FREE_LIST.lock());
247+
info!("Virtual memory free list:\n{}", KERNEL_FREE_LIST.lock());
246248
}
247249

248250
/// Maps a given physical address and size in virtual space and returns address.

src/mm/physicalmem.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,3 @@ pub fn reserve(physical_address: PhysAddr, size: usize) {
253253
// FIXME: Don't ignore errors anymore
254254
PHYSICAL_FREE_LIST.lock().allocate_at(range).ok();
255255
}
256-
257-
pub fn print_information() {
258-
let free_list = PHYSICAL_FREE_LIST.lock();
259-
info!("Physical memory free list:\n{free_list}");
260-
}

src/mm/virtualmem.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,3 @@ pub fn deallocate(virtual_address: VirtAddr, size: usize) {
168168
virtual_address
169169
);
170170
}*/
171-
172-
pub fn print_information() {
173-
let free_list = KERNEL_FREE_LIST.lock();
174-
info!("Virtual memory free list:\n{free_list}");
175-
}

0 commit comments

Comments
 (0)