TianoCore EDK2 master
Loading...
Searching...
No Matches
EntryPoint.c
Go to the documentation of this file.
1
7#include <Library/MemoryAllocationLib.h> // FreePool()
8#include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
9
10#include "SmbiosPlatformDxe.h"
11
23EFIAPI
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}
EFI_STATUS InstallAllStructures(IN EFI_SMBIOS_PROTOCOL *Smbios, IN UINT8 *TableAddress)
UINT8 * GetCloudHvSmbiosTables(VOID)
Definition: CloudHv.c:17
VOID EFIAPI FreePool(IN VOID *Buffer)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define PcdGet16(TokenName)
Definition: PcdLib.h:349
UINT8 * GetQemuSmbiosTables(VOID)
Definition: Qemu.c:21
EFI_STATUS EFIAPI SmbiosTablePublishEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: EntryPoint.c:24
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33