]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.h
1. Added EdkPciIncompatibleDeviceSupportLib in EdkModulePkg, this library is used...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / PciBus / Dxe / PciLib.h
index f8e88375d7a50a64c9d555de3d02c94823aebfae..17e3587cb03290c2424fa47d92ee65096d596974 100644 (file)
@@ -1,18 +1,18 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
   PciLib.h\r
-  \r
+\r
 Abstract:\r
 \r
   PCI Bus Driver Lib header file.\r
@@ -26,6 +26,15 @@ Revision History
 #ifndef _EFI_PCI_LIB_H\r
 #define _EFI_PCI_LIB_H\r
 \r
+//\r
+// Mask definistions for PCD PcdPciIncompatibleDeviceSupportMask\r
+//\r
+#define PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT         0x01\r
+#define PCI_INCOMPATIBLE_READ_SUPPORT                  0x02\r
+#define PCI_INCOMPATIBLE_WRITE_SUPPORT                 0x04\r
+#define PCI_INCOMPATIBLE_REGISTER_UPDATE_SUPPORT       0x08\r
+#define PCI_INCOMPATIBLE_ACCESS_WIDTH_SUPPORT          0x0a\r
+\r
 VOID\r
 InstallHotPlugRequestProtocol (\r
   IN  EFI_STATUS                    *Status\r
@@ -274,4 +283,103 @@ Returns:
 --*/\r
 ;\r
 \r
+/**\r
+  Read PCI configuration space through EFI_PCI_IO_PROTOCOL.\r
+\r
+  @param  PciIo               A pointer to the EFI_PCI_O_PROTOCOL.\r
+  @param  Width               Signifies the width of the memory operations.\r
+  @Param  Address             The address within the PCI configuration space for the PCI controller.\r
+  @param  Buffer              For read operations, the destination buffer to store the results. For\r
+                              write operations, the source buffer to write data from.\r
+\r
+  @retval EFI_SUCCESS            The data was read from or written to the PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Width is invalid for this PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+PciIoRead (\r
+  IN       EFI_PCI_IO_PROTOCOL                    *PciIo,\r
+  IN       EFI_PCI_IO_PROTOCOL_WIDTH              Width,\r
+  IN       UINT32                                 Address,\r
+  IN       UINTN                                  Count,\r
+  IN OUT   VOID                                   *Buffer\r
+  );\r
+\r
+/**\r
+  Write PCI configuration space through EFI_PCI_IO_PROTOCOL.\r
+\r
+  @param  PciIo               A pointer to the EFI_PCI_O_PROTOCOL.\r
+  @param  Width               Signifies the width of the memory operations.\r
+  @Param  Address             The address within the PCI configuration space for the PCI controller.\r
+  @param  Buffer              For read operations, the destination buffer to store the results. For\r
+                              write operations, the source buffer to write data from.\r
+\r
+  @retval EFI_SUCCESS            The data was read from or written to the PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Width is invalid for this PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+PciIoWrite (\r
+  IN       EFI_PCI_IO_PROTOCOL                    *PciIo,\r
+  IN       EFI_PCI_IO_PROTOCOL_WIDTH              Width,\r
+  IN       UINT32                                 Address,\r
+  IN       UINTN                                  Count,\r
+  IN OUT   VOID                                   *Buffer\r
+  );\r
+\r
+/**\r
+  Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+\r
+  @param  PciRootBridgeIo     A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Pci                 A pointer to PCI_TYPE00.\r
+  @param  Width               Signifies the width of the memory operations.\r
+  @Param  Address             The address within the PCI configuration space for the PCI controller.\r
+  @param  Buffer              For read operations, the destination buffer to store the results. For\r
+                              write operations, the source buffer to write data from.\r
+\r
+  @retval EFI_SUCCESS            The data was read from or written to the PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Width is invalid for this PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+PciRootBridgeIoWrite (\r
+  IN       EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL        *PciRootBridgeIo,\r
+  IN       PCI_TYPE00                             *Pci,\r
+  IN       EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,\r
+  IN       UINT64                                 Address,\r
+  IN       UINTN                                  Count,\r
+  IN OUT   VOID                                   *Buffer\r
+  );\r
+\r
+/**\r
+  Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+\r
+  @param  PciRootBridgeIo     A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Pci                 A pointer to PCI_TYPE00.\r
+  @param  Width               Signifies the width of the memory operations.\r
+  @Param  Address             The address within the PCI configuration space for the PCI controller.\r
+  @param  Buffer              For read operations, the destination buffer to store the results. For\r
+                              write operations, the source buffer to write data from.\r
+\r
+  @retval EFI_SUCCESS            The data was read from or written to the PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Width is invalid for this PCI root bridge.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+PciRootBridgeIoRead (\r
+  IN       EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL        *PciRootBridgeIo,\r
+  IN       PCI_TYPE00                             *Pci,\r
+  IN       EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,\r
+  IN       UINT64                                 Address,\r
+  IN       UINTN                                  Count,\r
+  IN OUT   VOID                                   *Buffer\r
+  );\r
 #endif\r