VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/PciHostBridgeLibNull/PciHostBridgeLibNull.c

Last change on this file was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
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 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9#include <PiDxe.h>
10#include <Library/PciHostBridgeLib.h>
11#include <Library/DebugLib.h>
12
13GLOBAL_REMOVE_IF_UNREFERENCED
14CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {
15 L"Mem", L"I/O", L"Bus"
16};
17
18/**
19 Return all the root bridge instances in an array.
20
21 @param Count Return the count of root bridge instances.
22
23 @return All the root bridge instances in an array.
24 The array should be passed into PciHostBridgeFreeRootBridges()
25 when it's not used.
26**/
27PCI_ROOT_BRIDGE *
28EFIAPI
29PciHostBridgeGetRootBridges (
30 UINTN *Count
31 )
32{
33 *Count = 0;
34 return NULL;
35}
36
37/**
38 Free the root bridge instances array returned from PciHostBridgeGetRootBridges().
39
40 @param Bridges The root bridge instances array.
41 @param Count The count of the array.
42**/
43VOID
44EFIAPI
45PciHostBridgeFreeRootBridges (
46 PCI_ROOT_BRIDGE *Bridges,
47 UINTN Count
48 )
49{
50 return;
51}
52
53/**
54 Inform the platform that the resource conflict happens.
55
56 @param HostBridgeHandle Handle of the Host Bridge.
57 @param Configuration Pointer to PCI I/O and PCI memory resource
58 descriptors. The Configuration contains the resources
59 for all the root bridges. The resource for each root
60 bridge is terminated with END descriptor and an
61 additional END is appended indicating the end of the
62 entire resources. The resource descriptor field
63 values follow the description in
64 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
65 .SubmitResources().
66**/
67VOID
68EFIAPI
69PciHostBridgeResourceConflict (
70 EFI_HANDLE HostBridgeHandle,
71 VOID *Configuration
72 )
73{
74 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor;
75 UINTN RootBridgeIndex;
76
77 DEBUG ((DEBUG_ERROR, "PciHostBridge: Resource conflict happens!\n"));
78
79 RootBridgeIndex = 0;
80 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Configuration;
81 while (Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) {
82 DEBUG ((DEBUG_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++));
83 for ( ; Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR; Descriptor++) {
84 ASSERT (
85 Descriptor->ResType <
86 (sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr) /
87 sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr[0])
88 )
89 );
90 DEBUG ((
91 DEBUG_ERROR,
92 " %s: Length/Alignment = 0x%lx / 0x%lx\n",
93 mPciHostBridgeLibAcpiAddressSpaceTypeStr[Descriptor->ResType],
94 Descriptor->AddrLen,
95 Descriptor->AddrRangeMax
96 ));
97 if (Descriptor->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM) {
98 DEBUG ((
99 DEBUG_ERROR,
100 " Granularity/SpecificFlag = %ld / %02x%s\n",
101 Descriptor->AddrSpaceGranularity,
102 Descriptor->SpecificFlag,
103 ((Descriptor->SpecificFlag &
104 EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE
105 ) != 0) ? L" (Prefetchable)" : L""
106 ));
107 }
108 }
109
110 //
111 // Skip the END descriptor for root bridge
112 //
113 ASSERT (Descriptor->Desc == ACPI_END_TAG_DESCRIPTOR);
114 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)(
115 (EFI_ACPI_END_TAG_DESCRIPTOR *)Descriptor + 1
116 );
117 }
118}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette