Browse Source

Add methods to AmlHandler for reading from PCI config space

Isaac Woods 4 years ago
parent
commit
e33dc862ac
2 changed files with 13 additions and 1 deletions
  1. 3 1
      aml/src/lib.rs
  2. 10 0
      aml_tester/src/main.rs

+ 3 - 1
aml/src/lib.rs

@@ -405,7 +405,9 @@ pub trait Handler {
     fn write_io_u16(&self, port: u16, value: u16);
     fn write_io_u32(&self, port: u16, value: u32);
 
-    // TODO: PCI config space accessing functions
+    fn read_pci_u8(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u8;
+    fn read_pci_u16(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u16;
+    fn read_pci_u32(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u32;
 }
 
 #[derive(Clone, Debug, PartialEq, Eq)]

+ 10 - 0
aml_tester/src/main.rs

@@ -186,4 +186,14 @@ impl aml::Handler for Handler {
     fn write_io_u32(&self, port: u16, value: u32) {
         unimplemented!()
     }
+
+    fn read_pci_u8(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u8 {
+        unimplemented!()
+    }
+    fn read_pci_u16(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u16 {
+        unimplemented!()
+    }
+    fn read_pci_u32(&self, segment: u16, bus: u8, device: u8, function: u8, offset: u16) -> u32 {
+        unimplemented!()
+    }
 }