TianoCore EDK2 master
Loading...
Searching...
No Matches
PciHostBridgeUtilityLib.c
Go to the documentation of this file.
1
15#include <Library/BaseLib.h>
17#include <Library/DebugLib.h>
19#include <Library/HardwareInfoLib.h>
22#include <Library/PciLib.h>
25
26#pragma pack(1)
27typedef struct {
28 ACPI_HID_DEVICE_PATH AcpiDevicePath;
29 EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
31#pragma pack ()
32
34CHAR16 *mPciHostBridgeUtilityLibAcpiAddressSpaceTypeStr[] = {
35 L"Mem", L"I/O", L"Bus"
36};
37
40OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH mRootBridgeDevicePathTemplate = {
41 {
42 {
44 ACPI_DP,
45 {
46 (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
47 (UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
48 }
49 },
50 EISA_PNP_ID (0x0A03), // HID
51 0 // UID
52 },
53
54 {
55 END_DEVICE_PATH_TYPE,
56 END_ENTIRE_DEVICE_PATH_SUBTYPE,
57 {
58 END_DEVICE_PATH_LENGTH,
59 0
60 }
61 }
62};
63
112EFIAPI
114 IN UINT64 Supports,
115 IN UINT64 Attributes,
116 IN UINT64 AllocAttributes,
117 IN BOOLEAN DmaAbove4G,
118 IN BOOLEAN NoExtendedConfigSpace,
119 IN UINT8 RootBusNumber,
120 IN UINT8 MaxSubBusNumber,
123 IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,
125 IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G,
126 OUT PCI_ROOT_BRIDGE *RootBus
127 )
128{
130
131 //
132 // Be safe if other fields are added to PCI_ROOT_BRIDGE later.
133 //
134 ZeroMem (RootBus, sizeof *RootBus);
135
136 RootBus->Segment = 0;
137
138 RootBus->Supports = Supports;
139 RootBus->Attributes = Attributes;
140
141 RootBus->DmaAbove4G = DmaAbove4G;
142
143 RootBus->AllocationAttributes = AllocAttributes;
144 RootBus->Bus.Base = RootBusNumber;
145 RootBus->Bus.Limit = MaxSubBusNumber;
146 CopyMem (&RootBus->Io, Io, sizeof (*Io));
147 CopyMem (&RootBus->Mem, Mem, sizeof (*Mem));
148 CopyMem (&RootBus->MemAbove4G, MemAbove4G, sizeof (*MemAbove4G));
149 CopyMem (&RootBus->PMem, PMem, sizeof (*PMem));
150 CopyMem (&RootBus->PMemAbove4G, PMemAbove4G, sizeof (*PMemAbove4G));
151
152 RootBus->NoExtendedConfigSpace = NoExtendedConfigSpace;
153
154 DevicePath = AllocateCopyPool (
155 sizeof mRootBridgeDevicePathTemplate,
156 &mRootBridgeDevicePathTemplate
157 );
158 if (DevicePath == NULL) {
159 DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
160 return EFI_OUT_OF_RESOURCES;
161 }
162
163 DevicePath->AcpiDevicePath.UID = RootBusNumber;
164 RootBus->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)DevicePath;
165
166 DEBUG ((
167 DEBUG_INFO,
168 "%a: populated root bus %d, with room for %d subordinate bus(es)\n",
169 __func__,
170 RootBusNumber,
171 MaxSubBusNumber - RootBusNumber
172 ));
173 return EFI_SUCCESS;
174}
175
185VOID
186EFIAPI
188 IN PCI_ROOT_BRIDGE *RootBus
189 )
190{
191 FreePool (RootBus->DevicePath);
192}
193
225STATIC
228 OUT UINTN *Count,
229 IN UINT64 Attributes,
230 IN UINT64 AllocationAttributes,
231 IN BOOLEAN DmaAbove4G,
232 IN BOOLEAN NoExtendedConfigSpace,
233 IN UINTN BusMin,
234 IN UINTN BusMax,
237 IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,
239 IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G
240 )
241{
242 EFI_STATUS Status;
243 FIRMWARE_CONFIG_ITEM FwCfgItem;
244 UINTN FwCfgSize;
245 UINT64 ExtraRootBridges;
246 PCI_ROOT_BRIDGE *Bridges;
247 UINTN Initialized;
248 UINTN LastRootBridgeNumber;
249 UINTN RootBridgeNumber;
250
251 if ((BusMin > BusMax) || (BusMax > PCI_MAX_BUS)) {
252 DEBUG ((
253 DEBUG_ERROR,
254 "%a: invalid bus range with BusMin %Lu and BusMax "
255 "%Lu\n",
256 __func__,
257 (UINT64)BusMin,
258 (UINT64)BusMax
259 ));
260 return NULL;
261 }
262
263 //
264 // QEMU provides the number of extra root buses, shortening the exhaustive
265 // search below. If there is no hint, the feature is missing.
266 //
267 Status = QemuFwCfgFindFile ("etc/extra-pci-roots", &FwCfgItem, &FwCfgSize);
268 if (EFI_ERROR (Status) || (FwCfgSize != sizeof ExtraRootBridges)) {
269 ExtraRootBridges = 0;
270 } else {
271 QemuFwCfgSelectItem (FwCfgItem);
272 QemuFwCfgReadBytes (FwCfgSize, &ExtraRootBridges);
273
274 //
275 // Validate the number of extra root bridges. As BusMax is inclusive, the
276 // max bus count is (BusMax - BusMin + 1). From that, the "main" root bus
277 // is always a given, so the max count for the "extra" root bridges is one
278 // less, i.e. (BusMax - BusMin). If the QEMU hint exceeds that, we have
279 // invalid behavior.
280 //
281 if (ExtraRootBridges > BusMax - BusMin) {
282 DEBUG ((
283 DEBUG_ERROR,
284 "%a: invalid count of extra root buses (%Lu) "
285 "reported by QEMU\n",
286 __func__,
287 ExtraRootBridges
288 ));
289 return NULL;
290 }
291
292 DEBUG ((
293 DEBUG_INFO,
294 "%a: %Lu extra root buses reported by QEMU\n",
295 __func__,
296 ExtraRootBridges
297 ));
298 }
299
300 //
301 // Allocate the "main" root bridge, and any extra root bridges.
302 //
303 Bridges = AllocatePool ((1 + (UINTN)ExtraRootBridges) * sizeof *Bridges);
304 if (Bridges == NULL) {
305 DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
306 return NULL;
307 }
308
309 Initialized = 0;
310
311 //
312 // The "main" root bus is always there.
313 //
314 LastRootBridgeNumber = BusMin;
315
316 //
317 // Scan all other root buses. If function 0 of any device on a bus returns a
318 // VendorId register value different from all-bits-one, then that bus is
319 // alive.
320 //
321 for (RootBridgeNumber = BusMin + 1;
322 RootBridgeNumber <= BusMax && Initialized < ExtraRootBridges;
323 ++RootBridgeNumber)
324 {
325 UINTN Device;
326
327 for (Device = 0; Device <= PCI_MAX_DEVICE; ++Device) {
328 if (PciRead16 (
330 RootBridgeNumber,
331 Device,
332 0,
333 PCI_VENDOR_ID_OFFSET
334 )
335 ) != MAX_UINT16)
336 {
337 break;
338 }
339 }
340
341 if (Device <= PCI_MAX_DEVICE) {
342 //
343 // Found the next root bus. We can now install the *previous* one,
344 // because now we know how big a bus number range *that* one has, for any
345 // subordinate buses that might exist behind PCI bridges hanging off it.
346 //
348 Attributes,
349 Attributes,
350 AllocationAttributes,
351 DmaAbove4G,
352 NoExtendedConfigSpace,
353 (UINT8)LastRootBridgeNumber,
354 (UINT8)(RootBridgeNumber - 1),
355 Io,
356 Mem,
357 MemAbove4G,
358 PMem,
359 PMemAbove4G,
360 &Bridges[Initialized]
361 );
362 if (EFI_ERROR (Status)) {
363 goto FreeBridges;
364 }
365
366 ++Initialized;
367 LastRootBridgeNumber = RootBridgeNumber;
368 }
369 }
370
371 //
372 // Install the last root bus (which might be the only, ie. main, root bus, if
373 // we've found no extra root buses).
374 //
376 Attributes,
377 Attributes,
378 AllocationAttributes,
379 DmaAbove4G,
380 NoExtendedConfigSpace,
381 (UINT8)LastRootBridgeNumber,
382 (UINT8)BusMax,
383 Io,
384 Mem,
385 MemAbove4G,
386 PMem,
387 PMemAbove4G,
388 &Bridges[Initialized]
389 );
390 if (EFI_ERROR (Status)) {
391 goto FreeBridges;
392 }
393
394 ++Initialized;
395
396 *Count = Initialized;
397 return Bridges;
398
399FreeBridges:
400 while (Initialized > 0) {
401 --Initialized;
402 PciHostBridgeUtilityUninitRootBridge (&Bridges[Initialized]);
403 }
404
405 FreePool (Bridges);
406 return NULL;
407}
408
418STATIC
421 OUT UINTN *Count
422 )
423{
424 EFI_STATUS Status;
425 FIRMWARE_CONFIG_ITEM FwCfgItem;
426 UINTN FwCfgSize;
427 PCI_ROOT_BRIDGE *Bridges;
428 UINTN Initialized;
429 UINTN LastRootBridgeNumber;
430 UINTN RootBridgeNumber;
431 UINTN PciHostBridgeCount;
432 UINT8 *HardwareInfoBlob;
433 LIST_ENTRY HwInfoList;
434 LIST_ENTRY *HwLink;
435 HARDWARE_INFO *HwInfo;
436 UINT64 Attributes;
437 UINT64 AllocationAttributes;
438 BOOLEAN DmaAbove4G;
439 BOOLEAN NoExtendedConfigSpace;
440 BOOLEAN CombineMemPMem;
443 PCI_ROOT_BRIDGE_APERTURE MemAbove4G;
445 PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;
446
447 //
448 // Initialize the Hardware Info list head to start with an empty but valid
449 // list head.
450 //
451 InitializeListHead (&HwInfoList);
452 HardwareInfoBlob = NULL;
453 Initialized = 0;
454 Bridges = NULL;
455 PciHostBridgeCount = 0;
456
457 //
458 // Hypervisor can provide the specifications (resources) for one or more
459 // PCI host bridges. Such information comes through fw-cfg as part of
460 // the hardware-info file.
461 //
462 Status = QemuFwCfgFindFile ("etc/hardware-info", &FwCfgItem, &FwCfgSize);
463
464 if (EFI_ERROR (Status)) {
465 return NULL;
466 }
467
468 HardwareInfoBlob = AllocatePool (FwCfgSize);
469
470 if (HardwareInfoBlob == NULL) {
471 DEBUG ((
472 DEBUG_ERROR,
473 "%a: Failed to allocate memory for hardware resources info\n",
474 __func__
475 ));
476 return NULL;
477 }
478
479 QemuFwCfgSelectItem (FwCfgItem);
480 QemuFwCfgReadBytes (FwCfgSize, HardwareInfoBlob);
481
482 //
483 // Create the list of hardware info devices filtering for PCI host
484 // bridges
485 //
486 Status = CreateHardwareInfoList (
487 HardwareInfoBlob,
488 FwCfgSize,
489 HardwareInfoTypeHostBridge,
490 &HwInfoList
491 );
492
493 if (EFI_ERROR (Status)) {
494 DEBUG ((
495 DEBUG_ERROR,
496 "%a: Failed to create hardware info list to retrieve host "
497 "bridges information from fw-cfg\n",
498 __func__
499 ));
500
501 goto FreeBridges;
502 }
503
504 PciHostBridgeCount = GetHardwareInfoCountByType (
505 &HwInfoList,
506 HardwareInfoTypeHostBridge,
507 sizeof (HOST_BRIDGE_INFO)
508 );
509
510 if (PciHostBridgeCount == 0) {
511 goto FreeBridges;
512 }
513
514 DEBUG ((
515 DEBUG_INFO,
516 "%a: Host provided description for %Lu root bridges\n",
517 __func__,
518 PciHostBridgeCount
519 ));
520
521 //
522 // Allocate the root bridges
523 //
524 Bridges = AllocatePool (((UINTN)PciHostBridgeCount) * sizeof *Bridges);
525 if (Bridges == NULL) {
526 DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
527 goto FreeBridges;
528 }
529
530 //
531 // If Host Bridges' specification was obtained from fw-cfg, the list
532 // contains information to populate all root bridges in the system
533 // including resources and attributes.
534 //
535 HwLink = GetFirstHardwareInfoByType (
536 &HwInfoList,
537 HardwareInfoTypeHostBridge,
538 sizeof (HOST_BRIDGE_INFO)
539 );
540
541 while (!EndOfHardwareInfoList (&HwInfoList, HwLink)) {
542 HwInfo = HARDWARE_INFO_FROM_LINK (HwLink);
543
545 HwInfo->Data.PciHostBridge,
546 (UINTN)HwInfo->Header.Size,
547 &RootBridgeNumber,
548 &LastRootBridgeNumber,
549 &Attributes,
550 &DmaAbove4G,
551 &NoExtendedConfigSpace,
552 &CombineMemPMem,
553 &Io,
554 &Mem,
555 &MemAbove4G,
556 &PMem,
557 &PMemAbove4G,
558 NULL
559 );
560
561 if (EFI_ERROR (Status)) {
562 goto FreeBridges;
563 }
564
565 if ((RootBridgeNumber > LastRootBridgeNumber) || (LastRootBridgeNumber > PCI_MAX_BUS)) {
566 DEBUG ((
567 DEBUG_ERROR,
568 "%a: invalid bus range with BusMin %Lu and BusMax "
569 "%Lu\n",
570 __func__,
571 (UINT64)RootBridgeNumber,
572 (UINT64)LastRootBridgeNumber
573 ));
574 goto FreeBridges;
575 }
576
577 AllocationAttributes = 0;
578 if (CombineMemPMem) {
579 AllocationAttributes |= EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM;
580 }
581
582 if ((MemAbove4G.Limit > MemAbove4G.Base) ||
583 (PMemAbove4G.Limit > PMemAbove4G.Base))
584 {
585 AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE;
586 }
587
589 Attributes,
590 Attributes,
591 AllocationAttributes,
592 DmaAbove4G,
593 NoExtendedConfigSpace,
594 (UINT8)RootBridgeNumber,
595 (UINT8)LastRootBridgeNumber,
596 &Io,
597 &Mem,
598 &MemAbove4G,
599 &PMem,
600 &PMemAbove4G,
601 &Bridges[Initialized]
602 );
603
604 if (EFI_ERROR (Status)) {
605 goto FreeBridges;
606 }
607
608 ++Initialized;
609
610 HwLink = GetNextHardwareInfoByType (
611 &HwInfoList,
612 HwLink,
613 HardwareInfoTypeHostBridge,
614 sizeof (HOST_BRIDGE_INFO)
615 );
616 }
617
618 *Count = Initialized;
619
620 //
621 // If resources were allocated for host bridges info, release them
622 //
623 if (HardwareInfoBlob) {
624 FreePool (HardwareInfoBlob);
625 }
626
627 FreeHardwareInfoList (&HwInfoList);
628 return Bridges;
629
630FreeBridges:
631 while (Initialized > 0) {
632 --Initialized;
633 PciHostBridgeUtilityUninitRootBridge (&Bridges[Initialized]);
634 }
635
636 if (Bridges) {
637 FreePool (Bridges);
638 }
639
640 if (HardwareInfoBlob) {
641 FreePool (HardwareInfoBlob);
642 }
643
644 FreeHardwareInfoList (&HwInfoList);
645 return NULL;
646}
647
678EFIAPI
680 OUT UINTN *Count,
681 IN UINT64 Attributes,
682 IN UINT64 AllocationAttributes,
683 IN BOOLEAN DmaAbove4G,
684 IN BOOLEAN NoExtendedConfigSpace,
685 IN UINTN BusMin,
686 IN UINTN BusMax,
689 IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,
691 IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G
692 )
693{
694 PCI_ROOT_BRIDGE *Bridges;
695
696 *Count = 0;
697
698 //
699 // First attempt to get the host provided descriptions of the Root Bridges
700 // if available.
701 //
703
704 //
705 // If host did not provide Root Bridge information, scan the buses and
706 // auto populate them with default resources.
707 //
708 if (Bridges == NULL) {
710 Count,
711 Attributes,
712 AllocationAttributes,
713 DmaAbove4G,
714 NoExtendedConfigSpace,
715 BusMin,
716 BusMax,
717 Io,
718 Mem,
719 MemAbove4G,
720 PMem,
721 PMemAbove4G
722 );
723 }
724
725 return Bridges;
726}
727
735VOID
736EFIAPI
738 IN PCI_ROOT_BRIDGE *Bridges,
739 IN UINTN Count
740 )
741{
742 if ((Bridges == NULL) && (Count == 0)) {
743 return;
744 }
745
746 ASSERT (Bridges != NULL && Count > 0);
747
748 do {
749 --Count;
750 PciHostBridgeUtilityUninitRootBridge (&Bridges[Count]);
751 } while (Count > 0);
752
753 FreePool (Bridges);
754}
755
770VOID
771EFIAPI
773 IN VOID *Configuration
774 )
775{
777 UINTN RootBridgeIndex;
778
779 DEBUG ((DEBUG_ERROR, "PciHostBridge: Resource conflict happens!\n"));
780
781 RootBridgeIndex = 0;
782 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Configuration;
783 while (Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) {
784 DEBUG ((DEBUG_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++));
785 for ( ; Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR; Descriptor++) {
786 ASSERT (
787 Descriptor->ResType <
788 ARRAY_SIZE (mPciHostBridgeUtilityLibAcpiAddressSpaceTypeStr)
789 );
790 DEBUG ((
791 DEBUG_ERROR,
792 " %s: Length/Alignment = 0x%lx / 0x%lx\n",
793 mPciHostBridgeUtilityLibAcpiAddressSpaceTypeStr[Descriptor->ResType],
794 Descriptor->AddrLen,
795 Descriptor->AddrRangeMax
796 ));
797 if (Descriptor->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM) {
798 DEBUG ((
799 DEBUG_ERROR,
800 " Granularity/SpecificFlag = %ld / %02x%s\n",
801 Descriptor->AddrSpaceGranularity,
802 Descriptor->SpecificFlag,
803 ((Descriptor->SpecificFlag &
804 EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE
805 ) != 0) ? L" (Prefetchable)" : L""
806 ));
807 }
808 }
809
810 //
811 // Skip the END descriptor for root bridge
812 //
813 ASSERT (Descriptor->Desc == ACPI_END_TAG_DESCRIPTOR);
814 Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)(
815 (EFI_ACPI_END_TAG_DESCRIPTOR *)Descriptor + 1
816 );
817 }
818}
UINT64 UINTN
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
Definition: LinkedList.c:182
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define ACPI_DP
Definition: DevicePath.h:195
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS HardwareInfoPciHostBridgeGet(IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, OUT UINTN *BusNrStart, OUT UINTN *BusNrLast, OUT UINT64 *Attributes OPTIONAL, OUT BOOLEAN *DmaAbove4G OPTIONAL, OUT BOOLEAN *NoExtendedConfigSpace OPTIONAL, OUT BOOLEAN *CombineMemPMem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *Io OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *Mem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *MemAbove4G OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PMem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PcieConfig OPTIONAL)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define ARRAY_SIZE(Array)
Definition: Base.h:1393
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define PCI_LIB_ADDRESS(Bus, Device, Function, Register)
Definition: PciLib.h:34
UINT16 EFIAPI PciRead16(IN UINTN Address)
Definition: PciLib.c:396
#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM
#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE
STATIC PCI_ROOT_BRIDGE * PciHostBridgeUtilityGetRootBridgesHostProvided(OUT UINTN *Count)
STATIC PCI_ROOT_BRIDGE * PciHostBridgeUtilityGetRootBridgesBusScan(OUT UINTN *Count, IN UINT64 Attributes, IN UINT64 AllocationAttributes, IN BOOLEAN DmaAbove4G, IN BOOLEAN NoExtendedConfigSpace, IN UINTN BusMin, IN UINTN BusMax, IN PCI_ROOT_BRIDGE_APERTURE *Io, IN PCI_ROOT_BRIDGE_APERTURE *Mem, IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, IN PCI_ROOT_BRIDGE_APERTURE *PMem, IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G)
EFI_STATUS EFIAPI PciHostBridgeUtilityInitRootBridge(IN UINT64 Supports, IN UINT64 Attributes, IN UINT64 AllocAttributes, IN BOOLEAN DmaAbove4G, IN BOOLEAN NoExtendedConfigSpace, IN UINT8 RootBusNumber, IN UINT8 MaxSubBusNumber, IN PCI_ROOT_BRIDGE_APERTURE *Io, IN PCI_ROOT_BRIDGE_APERTURE *Mem, IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, IN PCI_ROOT_BRIDGE_APERTURE *PMem, IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G, OUT PCI_ROOT_BRIDGE *RootBus)
VOID EFIAPI PciHostBridgeUtilityFreeRootBridges(IN PCI_ROOT_BRIDGE *Bridges, IN UINTN Count)
PCI_ROOT_BRIDGE *EFIAPI PciHostBridgeUtilityGetRootBridges(OUT UINTN *Count, IN UINT64 Attributes, IN UINT64 AllocationAttributes, IN BOOLEAN DmaAbove4G, IN BOOLEAN NoExtendedConfigSpace, IN UINTN BusMin, IN UINTN BusMax, IN PCI_ROOT_BRIDGE_APERTURE *Io, IN PCI_ROOT_BRIDGE_APERTURE *Mem, IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, IN PCI_ROOT_BRIDGE_APERTURE *PMem, IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G)
VOID EFIAPI PciHostBridgeUtilityUninitRootBridge(IN PCI_ROOT_BRIDGE *RootBus)
VOID EFIAPI PciHostBridgeUtilityResourceConflict(IN VOID *Configuration)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
Definition: QemuFwCfgLib.c:250
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
Definition: QemuFwCfgNull.c:66
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
Definition: QemuFwCfgLib.c:33
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112