VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAcpiBoardInfo.c@ 89983

Last change on this file since 89983 was 89983, checked in by vboxsync, 3 years ago

Devices/EFI: Merge edk-stable202105 and openssl 1.1.1j and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1/** @file
2 PCI Segment Information Library that returns one segment whose
3 segment base address is retrieved from AcpiBoardInfo HOB.
4
5 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#include <PiDxe.h>
11#include <Guid/AcpiBoardInfoGuid.h>
12
13#include <Library/HobLib.h>
14#include <Library/PciSegmentInfoLib.h>
15#include <Library/DebugLib.h>
16
17STATIC PCI_SEGMENT_INFO mPciSegment0 = {
18 0, // Segment number
19 0, // To be fixed later
20 0, // Start bus number
21 255 // End bus number
22};
23
24/**
25 Return an array of PCI_SEGMENT_INFO holding the segment information.
26
27 Note: The returned array/buffer is owned by callee.
28
29 @param Count Return the count of segments.
30
31 @retval A callee owned array holding the segment information.
32**/
33PCI_SEGMENT_INFO *
34EFIAPI
35GetPciSegmentInfo (
36 UINTN *Count
37 )
38{
39 EFI_HOB_GUID_TYPE *GuidHob;
40 ACPI_BOARD_INFO *AcpiBoardInfo;
41
42 ASSERT (Count != NULL);
43 if (Count == NULL) {
44 return NULL;
45 }
46
47 if (mPciSegment0.BaseAddress == 0) {
48 //
49 // Find the acpi board information guid hob
50 //
51 GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);
52 ASSERT (GuidHob != NULL);
53
54 AcpiBoardInfo = (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (GuidHob);
55 mPciSegment0.BaseAddress = AcpiBoardInfo->PcieBaseAddress;
56 }
57 *Count = 1;
58 return &mPciSegment0;
59}
Note: See TracBrowser for help on using the repository browser.

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