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