]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h
MdeModulePkg/NonDiscoverablePciDeviceDxe: add support for non-coherent DMA
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / NonDiscoverablePciDeviceDxe / NonDiscoverablePciDeviceIo.h
index bc0a3d3258f9bab4a05750fa51613d6947289514..4496148629110df64d8a4091b7ff4bede08d9df0 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef __NON_DISCOVERABLE_PCI_DEVICE_IO_H__\r
 #define __NON_DISCOVERABLE_PCI_DEVICE_IO_H__\r
 \r
+#include <PiDxe.h>\r
+\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
@@ -25,6 +27,7 @@
 \r
 #include <Protocol/ComponentName.h>\r
 #include <Protocol/NonDiscoverableDevice.h>\r
+#include <Protocol/Cpu.h>\r
 #include <Protocol/PciIo.h>\r
 \r
 #define NON_DISCOVERABLE_PCI_DEVICE_SIG SIGNATURE_32 ('P', 'P', 'I', 'D')\r
 \r
 #define PCI_MAX_BARS                  6\r
 \r
+extern EFI_CPU_ARCH_PROTOCOL      *mCpu;\r
+\r
+typedef struct {\r
+  //\r
+  // The linked-list next pointer\r
+  //\r
+  LIST_ENTRY          List;\r
+  //\r
+  // The address of the uncached allocation\r
+  //\r
+  VOID                *HostAddress;\r
+  //\r
+  // The number of pages in the allocation\r
+  //\r
+  UINTN               NumPages;\r
+  //\r
+  // The attributes of the allocation\r
+  //\r
+  UINT64              Attributes;\r
+} NON_DISCOVERABLE_DEVICE_UNCACHED_ALLOCATION;\r
+\r
 typedef struct {\r
   UINT32                    Signature;\r
   //\r
@@ -71,6 +95,11 @@ typedef struct {
   // Whether this device has been enabled\r
   //\r
   BOOLEAN                   Enabled;\r
+  //\r
+  // Linked list to keep track of uncached allocations performed\r
+  // on behalf of this device\r
+  //\r
+  LIST_ENTRY                UncachedAllocationList;\r
 } NON_DISCOVERABLE_PCI_DEVICE;\r
 \r
 VOID\r