1 | /** @file
|
---|
2 | OVMF's instance of the PCI Host Bridge Library, for Bhyve and Xen guests.
|
---|
3 |
|
---|
4 | Copyright (C) 2016-2021, Red Hat, Inc.
|
---|
5 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
---|
6 |
|
---|
7 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 |
|
---|
9 | **/
|
---|
10 | #include <Library/PciHostBridgeLib.h> // PCI_ROOT_BRIDGE
|
---|
11 | #include <Library/PciHostBridgeUtilityLib.h> // PciHostBridgeUtilit...
|
---|
12 |
|
---|
13 | #include "PciHostBridge.h"
|
---|
14 |
|
---|
15 | /**
|
---|
16 | Return all the root bridge instances in an array.
|
---|
17 |
|
---|
18 | @param Count Return the count of root bridge instances.
|
---|
19 |
|
---|
20 | @return All the root bridge instances in an array.
|
---|
21 | The array should be passed into PciHostBridgeFreeRootBridges()
|
---|
22 | when it's not used.
|
---|
23 | **/
|
---|
24 | PCI_ROOT_BRIDGE *
|
---|
25 | EFIAPI
|
---|
26 | PciHostBridgeGetRootBridges (
|
---|
27 | UINTN *Count
|
---|
28 | )
|
---|
29 | {
|
---|
30 | return ScanForRootBridges (Count);
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | Free the root bridge instances array returned from
|
---|
35 | PciHostBridgeGetRootBridges().
|
---|
36 |
|
---|
37 | @param The root bridge instances array.
|
---|
38 | @param The count of the array.
|
---|
39 | **/
|
---|
40 | VOID
|
---|
41 | EFIAPI
|
---|
42 | PciHostBridgeFreeRootBridges (
|
---|
43 | PCI_ROOT_BRIDGE *Bridges,
|
---|
44 | UINTN Count
|
---|
45 | )
|
---|
46 | {
|
---|
47 | PciHostBridgeUtilityFreeRootBridges (Bridges, Count);
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | Inform the platform that the resource conflict happens.
|
---|
52 |
|
---|
53 | @param HostBridgeHandle Handle of the Host Bridge.
|
---|
54 | @param Configuration Pointer to PCI I/O and PCI memory resource
|
---|
55 | descriptors. The Configuration contains the resources
|
---|
56 | for all the root bridges. The resource for each root
|
---|
57 | bridge is terminated with END descriptor and an
|
---|
58 | additional END is appended indicating the end of the
|
---|
59 | entire resources. The resource descriptor field
|
---|
60 | values follow the description in
|
---|
61 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
---|
62 | .SubmitResources().
|
---|
63 | **/
|
---|
64 | VOID
|
---|
65 | EFIAPI
|
---|
66 | PciHostBridgeResourceConflict (
|
---|
67 | EFI_HANDLE HostBridgeHandle,
|
---|
68 | VOID *Configuration
|
---|
69 | )
|
---|
70 | {
|
---|
71 | PciHostBridgeUtilityResourceConflict (Configuration);
|
---|
72 | }
|
---|