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