]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
OvmfPkg: Enable 2 different CpuMpPei and CpuDxe drivers
[mirror_edk2.git] / OvmfPkg / SmbiosPlatformDxe / EntryPoint.c
1 /** @file
2 Find and extract SMBIOS data.
3
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5 **/
6
7 #include <Library/MemoryAllocationLib.h> // FreePool()
8 #include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
9
10 #include "SmbiosPlatformDxe.h"
11
12 /**
13 Installs SMBIOS information for OVMF
14
15 @param ImageHandle Module's image handle
16 @param SystemTable Pointer of EFI_SYSTEM_TABLE
17
18 @retval EFI_SUCCESS Smbios data successfully installed
19 @retval Other Smbios data was not installed
20
21 **/
22 EFI_STATUS
23 EFIAPI
24 SmbiosTablePublishEntry (
25 IN EFI_HANDLE ImageHandle,
26 IN EFI_SYSTEM_TABLE *SystemTable
27 )
28 {
29 EFI_STATUS Status;
30 UINT8 *SmbiosTables;
31 UINT16 HostBridgeDevId;
32
33 Status = EFI_NOT_FOUND;
34 //
35 // Add SMBIOS data if found
36 //
37 HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
38 if (HostBridgeDevId == CLOUDHV_DEVICE_ID) {
39 SmbiosTables = GetCloudHvSmbiosTables ();
40 if (SmbiosTables != NULL) {
41 Status = InstallAllStructures (SmbiosTables);
42 }
43 } else {
44 SmbiosTables = GetQemuSmbiosTables ();
45 if (SmbiosTables != NULL) {
46 Status = InstallAllStructures (SmbiosTables);
47 FreePool (SmbiosTables);
48 }
49 }
50
51 return Status;
52 }