diff --git a/arch/x86_64/src/acpi/mod.rs b/arch/x86_64/src/acpi/mod.rs index b6c05ff9a523fb92fafe61260906f7b9b88c4cfc..c5224f97af4eb588301851cc014cc79179fe9976 100644 --- a/arch/x86_64/src/acpi/mod.rs +++ b/arch/x86_64/src/acpi/mod.rs @@ -30,9 +30,9 @@ const TRAMPOLINE: usize = 0x7E00; const AP_STARTUP: usize = TRAMPOLINE + 512; pub enum AcpiTable { - fadt(Fadt), - madt(Madt), - dmar(Dmar) + Fadt(Fadt), + Madt(Madt), + Dmar(Dmar) } pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) -> Option<AcpiTable> { @@ -43,7 +43,7 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) -> Option if let Some(fadt) = Fadt::new(sdt) { println!(": {:#?}", fadt); - Some(AcpiTable::fadt(fadt)) + Some(AcpiTable::Fadt(fadt)) } else if let Some(madt) = Madt::new(sdt) { println!(": {:>08X}: {}", madt.local_address, madt.flags); @@ -147,7 +147,7 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) -> Option // Unmap trampoline let result = active_table.unmap(trampoline_page); result.flush(active_table); - Some(AcpiTable::madt(madt)) + Some(AcpiTable::Madt(madt)) } else if let Some(dmar) = Dmar::new(sdt) { println!(": {}: {}", dmar.addr_width, dmar.flags); @@ -167,7 +167,7 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) -> Option _ => () } } - Some(AcpiTable::dmar(dmar)) + Some(AcpiTable::Dmar(dmar)) } else { println!(": Unknown"); None @@ -179,7 +179,7 @@ pub unsafe fn init(active_table: &mut ActivePageTable) { let start_addr = 0xE0000; let end_addr = 0xFFFFF; - let mut theFADT: Option<Fadt> = None; + let mut fadt_opt: Option<Fadt> = None; // Map all of the ACPI RSDP space { @@ -231,7 +231,7 @@ pub unsafe fn init(active_table: &mut ActivePageTable) { // TODO: Eventually, save pointers to all tables containing pertinent information to other parts of // the kernel match init_sdt(sdt, active_table) { - Some(AcpiTable::fadt(fadt)) => theFADT = Some(fadt), + Some(AcpiTable::Fadt(fadt)) => fadt_opt = Some(fadt), _ => drop_sdt(sdt, mapped, active_table) } } @@ -243,7 +243,7 @@ pub unsafe fn init(active_table: &mut ActivePageTable) { // TODO: Eventually, save pointers to all tables containing pertinent information to other parts of // the kernel match init_sdt(sdt, active_table) { - Some(AcpiTable::fadt(fadt)) => theFADT = Some(fadt), + Some(AcpiTable::Fadt(fadt)) => fadt_opt = Some(fadt), _ => drop_sdt(sdt, mapped, active_table) } } @@ -267,7 +267,7 @@ pub unsafe fn init(active_table: &mut ActivePageTable) { } } - if let Some(fadt) = theFADT { + if let Some(fadt) = fadt_opt { ACPI_TABLE.lock().fadt = Some(fadt); } } diff --git a/arch/x86_64/src/context.rs b/arch/x86_64/src/context.rs index 2a8242d9b8d20a6a5acc8c5d02d930d53bbc9cc1..f9c4e02188152ca0808011a806c140b5723631bf 100644 --- a/arch/x86_64/src/context.rs +++ b/arch/x86_64/src/context.rs @@ -127,6 +127,7 @@ impl Context { } } +#[allow(dead_code)] #[repr(packed)] pub struct SignalHandlerStack { r11: usize, diff --git a/arch/x86_64/src/device/rtc.rs b/arch/x86_64/src/device/rtc.rs index bed9d7552f493123a2e823aa11d7a2588d7bd10a..944988b0d5d9cb8667ce5119510db2ccd9ad619e 100644 --- a/arch/x86_64/src/device/rtc.rs +++ b/arch/x86_64/src/device/rtc.rs @@ -55,7 +55,7 @@ impl Rtc { } else { None }; - + unsafe { self.wait(); second = self.read(0) as usize; @@ -79,7 +79,7 @@ impl Rtc { day = cvt_bcd(day); month = cvt_bcd(month); year = cvt_bcd(year); - century = if let Some(century_reg) = century_register { + century = if century_register.is_some() { cvt_bcd(century) } else { century diff --git a/arch/x86_64/src/lib.rs b/arch/x86_64/src/lib.rs index 1b0847ebb8a0b41da3effd28cb860ae71ea9f96d..0ac508dadeec67708e7ccab89181318db4236b94 100644 --- a/arch/x86_64/src/lib.rs +++ b/arch/x86_64/src/lib.rs @@ -1,5 +1,6 @@ //! Architecture support for x86_64 +//#![deny(warnings)] #![deny(unused_must_use)] #![feature(asm)] #![feature(concat_idents)] @@ -148,6 +149,7 @@ macro_rules! interrupt { }; } +#[allow(dead_code)] #[repr(packed)] pub struct InterruptStack { fs: usize, @@ -214,6 +216,7 @@ macro_rules! interrupt_stack { }; } +#[allow(dead_code)] #[repr(packed)] pub struct InterruptErrorStack { fs: usize,