Parcourir la source

rsdp: Make whole RSDP readable

Niklas Sombert il y a 2 ans
Parent
commit
24ef7f740c
1 fichiers modifiés avec 18 ajouts et 0 suppressions
  1. 18 0
      rsdp/src/lib.rs

+ 18 - 0
rsdp/src/lib.rs

@@ -169,6 +169,14 @@ impl Rsdp {
         Ok(())
     }
 
+    pub fn signature(&self) -> [u8; 8] {
+        self.signature
+    }
+
+    pub fn checksum(&self) -> u8 {
+        self.checksum
+    }
+
     pub fn oem_id(&self) -> &str {
         str::from_utf8(&self.oem_id).unwrap()
     }
@@ -181,10 +189,20 @@ impl Rsdp {
         self.rsdt_address
     }
 
+    pub fn length(&self) -> u32 {
+        assert!(self.revision > 0, "Tried to read extended RSDP field with ACPI Version 1.0");
+        self.length
+    }
+
     pub fn xsdt_address(&self) -> u64 {
         assert!(self.revision > 0, "Tried to read extended RSDP field with ACPI Version 1.0");
         self.xsdt_address
     }
+
+    pub fn ext_checksum(&self) -> u8 {
+        assert!(self.revision > 0, "Tried to read extended RSDP field with ACPI Version 1.0");
+        self.ext_checksum
+    }
 }
 
 /// Find the areas we should search for the RSDP in.