浏览代码

rsdp: Make whole RSDP readable

Niklas Sombert 2 年之前
父节点
当前提交
24ef7f740c
共有 1 个文件被更改,包括 18 次插入0 次删除
  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.