Clippy, formatting
This commit is contained in:
parent
9295b6f3f7
commit
b02c34fd1d
@ -3,8 +3,12 @@
|
|||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use crate::{format, log_info, memory::HHDM_RESPONSE, LogLevel, LOGGER};
|
use crate::{LOGGER, LogLevel, format, log_info, memory::HHDM_RESPONSE};
|
||||||
use x86_64::{registers::control::*, structures::paging::{Page, PageTable, PageTableFlags}, PhysAddr, VirtAddr};
|
use x86_64::{
|
||||||
|
PhysAddr, VirtAddr,
|
||||||
|
registers::control::*,
|
||||||
|
structures::paging::{PageTable, PageTableFlags},
|
||||||
|
};
|
||||||
|
|
||||||
pub fn get_mappings() {
|
pub fn get_mappings() {
|
||||||
log_info!("Paging: {}", Cr0::read().contains(Cr0Flags::PAGING));
|
log_info!("Paging: {}", Cr0::read().contains(Cr0Flags::PAGING));
|
||||||
@ -53,13 +57,21 @@ fn iter_table(table: &'static mut PageTable, level: usize) {
|
|||||||
if level == 1 {
|
if level == 1 {
|
||||||
for page_entry in table.iter() {
|
for page_entry in table.iter() {
|
||||||
if page_entry.flags().contains(PageTableFlags::PRESENT) {
|
if page_entry.flags().contains(PageTableFlags::PRESENT) {
|
||||||
log_info!("Page entry: 0x{:x}, flags: {:?}", page_entry.addr(), page_entry.flags());
|
log_info!(
|
||||||
|
"Page entry: 0x{:x}, flags: {:?}",
|
||||||
|
page_entry.addr(),
|
||||||
|
page_entry.flags()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for table_entry in table.iter() {
|
for table_entry in table.iter() {
|
||||||
if table_entry.flags().contains(PageTableFlags::PRESENT) {
|
if table_entry.flags().contains(PageTableFlags::PRESENT) {
|
||||||
log_info!("Table entry: 0x{:x}, flags: {:?}", table_entry.addr(), table_entry.flags());
|
log_info!(
|
||||||
|
"Table entry: 0x{:x}, flags: {:?}",
|
||||||
|
table_entry.addr(),
|
||||||
|
table_entry.flags()
|
||||||
|
);
|
||||||
iter_table(table_from_phys_addr(table_entry.addr()), level - 1);
|
iter_table(table_from_phys_addr(table_entry.addr()), level - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,6 @@ impl SerialPort {
|
|||||||
self.write_char(c);
|
self.write_char(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_transmit_empty(&mut self) -> bool {
|
pub fn is_transmit_empty(&mut self) -> bool {
|
||||||
|
|||||||
@ -34,7 +34,7 @@ use lazy_static::lazy_static;
|
|||||||
use limine::firmware_type::FirmwareType;
|
use limine::firmware_type::FirmwareType;
|
||||||
use spin::mutex::Mutex;
|
use spin::mutex::Mutex;
|
||||||
|
|
||||||
use crate::{arch::x86_64::cpuid::{CPUID, virt_supported}, panic::panic};
|
use crate::arch::x86_64::cpuid::{CPUID, virt_supported};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref SERIAL_3F8: Mutex<SerialPort> =
|
pub static ref SERIAL_3F8: Mutex<SerialPort> =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user