--- /dev/null
+/** @file\r
+ Provides services to return segment information on a platform with multiple PCI segments.\r
+\r
+ This library is consumed by PciSegmentLib to support multiple segment PCI configuration access.\r
+\r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ 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
+**/\r
+\r
+#ifndef __PCI_SEGMENT_INFO_LIB__\r
+#define __PCI_SEGMENT_INFO_LIB__\r
+\r
+typedef struct {\r
+ UINT16 SegmentNumber; ///< Segment number.\r
+ UINT64 BaseAddress; ///< ECAM Base address.\r
+ UINT8 StartBusNumber; ///< Start BUS number, for verifying the PCI Segment address.\r
+ UINT8 EndBusNumber; ///< End BUS number, for verifying the PCI Segment address.\r
+} PCI_SEGMENT_INFO;\r
+\r
+/**\r
+ Return an array of PCI_SEGMENT_INFO holding the segment information.\r
+\r
+ Note: The returned array/buffer is owned by callee.\r
+\r
+ @param Count Return the count of segments.\r
+\r
+ @retval A callee owned array holding the segment information.\r
+**/\r
+PCI_SEGMENT_INFO *\r
+GetPciSegmentInfo (\r
+ UINTN *Count\r
+ );\r
+\r
+#endif\r
--- /dev/null
+## @file\r
+# Instance of PCI SegmentInfo Library.\r
+#\r
+# Default PCI Segment Information Library that shouldn't be used by real platform.\r
+#\r
+# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+#\r
+# 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
+# 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
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = BasePciSegmentInfoLibNull\r
+ MODULE_UNI_FILE = BasePciSegmentInfoLibNull.uni\r
+ FILE_GUID = 36B28584-C6AE-4B1B-A473-A51618EE525A\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = PciSegmentInfoLib\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources]\r
+ PciSegmentInfoLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+ PcdLib\r
+ DebugLib\r
--- /dev/null
+// /** @file\r
+// Instance of PCI SegmentInfo Library.\r
+//\r
+// Default PCI Segment Information Library that shouldn't be used by real platform.\r
+//\r
+// Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+//\r
+// 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
+// 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
+// **/\r
+\r
+\r
+#string STR_MODULE_ABSTRACT #language en-US "Default instance of PCI SegmentInfo Library."\r
+\r
+#string STR_MODULE_DESCRIPTION #language en-US "Default PCI Segment Information Library that shouldn't be used by real platform."\r
--- /dev/null
+/** @file\r
+ Default PCI Segment Information Library that returns one segment whose\r
+ segment base address equals to PcdPciExpressBaseAddress.\r
+\r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials are\r
+ licensed and made available under the terms and conditions of\r
+ the BSD License which accompanies this distribution. The full\r
+ 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
+**/\r
+\r
+#include <Base.h>\r
+#include <Library/PciSegmentInfoLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+/**\r
+ Return an array of PCI_SEGMENT_INFO holding the segment information.\r
+\r
+ Note: The returned array/buffer is owned by callee.\r
+\r
+ @param Count Return the count of segments.\r
+\r
+ @retval A callee owned array holding the segment information.\r
+**/\r
+PCI_SEGMENT_INFO *\r
+GetPciSegmentInfo (\r
+ UINTN *Count\r
+ )\r
+{\r
+ ASSERT (FALSE);\r
+ *Count = 0;\r
+ return NULL;\r
+}\r
## @libraryclass Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.\r
PeCoffGetEntryPointLib|Include/Library/PeCoffGetEntryPointLib.h\r
\r
+ ## @libraryclass Provides services to return the PCI segment information.\r
+ PciSegmentInfoLib|Include/Library/PciSegmentInfoLib.h\r
+\r
## @libraryclass Provides services to access PCI Configuration Space on a platform with multiple PCI segments.\r
PciSegmentLib|Include/Library/PciSegmentLib.h\r
\r
MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf\r
MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf\r
+ MdePkg/Library/BasePciSegmentInfoLibNull/BasePciSegmentInfoLibNull.inf\r
MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r