]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/PciHostBridgeLibNull/PciHostBridgeLibNull.c
BaseTools: fix LzmaCompress VS2013 make failure
[mirror_edk2.git] / MdeModulePkg / Library / PciHostBridgeLibNull / PciHostBridgeLibNull.c
CommitLineData
7ff66d3c
RN
1/** @file\r
2 Null instance of PCI Host Bridge Library with empty functions.\r
3\r
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials are\r
6 licensed and made available under the terms and conditions of\r
7 the BSD License which accompanies this distribution. The full\r
8 text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15#include <PiDxe.h>\r
16#include <Library/PciHostBridgeLib.h>\r
17#include <Library/DebugLib.h>\r
18\r
19GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {\r
20 L"Mem", L"I/O", L"Bus"\r
21};\r
22\r
23/**\r
24 Return all the root bridge instances in an array.\r
25\r
26 @param Count Return the count of root bridge instances.\r
27\r
28 @return All the root bridge instances in an array.\r
29 The array should be passed into PciHostBridgeFreeRootBridges()\r
30 when it's not used.\r
31**/\r
32PCI_ROOT_BRIDGE *\r
33EFIAPI\r
34PciHostBridgeGetRootBridges (\r
35 UINTN *Count\r
36 )\r
37{\r
38 *Count = 0;\r
39 return NULL;\r
40}\r
41\r
42/**\r
43 Free the root bridge instances array returned from PciHostBridgeGetRootBridges().\r
44\r
45 @param The root bridge instances array.\r
46 @param The count of the array.\r
47**/\r
48VOID\r
49EFIAPI\r
50PciHostBridgeFreeRootBridges (\r
51 PCI_ROOT_BRIDGE *Bridges,\r
52 UINTN Count\r
53 )\r
54{\r
55 return;\r
56}\r
57\r
58/**\r
59 Inform the platform that the resource conflict happens.\r
60\r
61 @param HostBridgeHandle Handle of the Host Bridge.\r
62 @param Configuration Pointer to PCI I/O and PCI memory resource descriptors.\r
63 The Configuration contains the resources for all the\r
64 root bridges. The resource for each root bridge is\r
65 terminated with END descriptor and an additional END\r
66 is appended indicating the end of the entire resources.\r
67 The resource descriptor field values follow the description\r
68 in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.SubmitResources().\r
69**/\r
70VOID\r
71EFIAPI\r
72PciHostBridgeResourceConflict (\r
73 EFI_HANDLE HostBridgeHandle,\r
74 VOID *Configuration\r
75 )\r
76{\r
77 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor;\r
78 UINTN RootBridgeIndex;\r
79 DEBUG ((EFI_D_ERROR, "PciHostBridge: Resource conflict happens!\n"));\r
80\r
81 RootBridgeIndex = 0;\r
82 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *) Configuration;\r
83 while (Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) {\r
84 DEBUG ((EFI_D_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++));\r
85 for (; Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR; Descriptor++) {\r
86 ASSERT (Descriptor->ResType <\r
87 sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr) / sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr[0])\r
88 );\r
89 DEBUG ((EFI_D_ERROR, " %s: Length/Alignment = 0x%lx / 0x%lx\n",\r
90 mPciHostBridgeLibAcpiAddressSpaceTypeStr[Descriptor->ResType], Descriptor->AddrLen, Descriptor->AddrRangeMax));\r
91 if (Descriptor->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM) {\r
92 DEBUG ((EFI_D_ERROR, " Granularity/SpecificFlag = %ld / %02x%s\n",\r
93 Descriptor->AddrSpaceGranularity, Descriptor->SpecificFlag,\r
94 ((Descriptor->SpecificFlag & EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE) != 0) ? L" (Prefetchable)" : L""\r
95 ));\r
96 }\r
97 }\r
98 //\r
99 // Skip the END descriptor for root bridge\r
100 //\r
101 ASSERT (Descriptor->Desc == ACPI_END_TAG_DESCRIPTOR);\r
102 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *) ((EFI_ACPI_END_TAG_DESCRIPTOR *) Descriptor + 1);\r
103 }\r
104}\r