TianoCore EDK2 master
Loading...
Searching...
No Matches
PlatformInitLib.h File Reference
#include <PiPei.h>

Go to the source code of this file.

Data Structures

struct  EFI_HOB_PLATFORM_INFO
 

Functions

UINT8 EFIAPI PlatformCmosRead8 (IN UINTN Index)
 
UINT8 EFIAPI PlatformCmosWrite8 (IN UINTN Index, IN UINT8 Value)
 
VOID EFIAPI PlatformDebugDumpCmos (VOID)
 
VOID EFIAPI PlatformAddIoMemoryBaseSizeHob (IN EFI_PHYSICAL_ADDRESS MemoryBase, IN UINT64 MemorySize)
 
VOID EFIAPI PlatformAddIoMemoryRangeHob (IN EFI_PHYSICAL_ADDRESS MemoryBase, IN EFI_PHYSICAL_ADDRESS MemoryLimit)
 
VOID EFIAPI PlatformAddMemoryBaseSizeHob (IN EFI_PHYSICAL_ADDRESS MemoryBase, IN UINT64 MemorySize)
 
VOID EFIAPI PlatformAddMemoryRangeHob (IN EFI_PHYSICAL_ADDRESS MemoryBase, IN EFI_PHYSICAL_ADDRESS MemoryLimit)
 
VOID EFIAPI PlatformAddReservedMemoryBaseSizeHob (IN EFI_PHYSICAL_ADDRESS MemoryBase, IN UINT64 MemorySize, IN BOOLEAN Cacheable)
 
VOID EFIAPI PlatformQemuUc32BaseInitialization (IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformGetSystemMemorySizeBelow4gb (IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformAddressWidthInitialization (IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformQemuInitializeRam (IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformQemuInitializeRamForS3 (IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformMemMapInitialization (IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
EFI_STATUS EFIAPI PlatformNoexecDxeInitialization (IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformMiscInitialization (IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformMaxCpuCountInitialization (IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob)
 
VOID EFIAPI PlatformTdxPublishRamRegions (VOID)
 
BOOLEAN EFIAPI PlatformValidateNvVarStore (IN UINT8 *NvVarStoreBase, IN UINT32 NvVarStoreSize)
 
VOID *EFIAPI PlatformReserveEmuVariableNvStore (VOID)
 
EFI_STATUS EFIAPI PlatformInitEmuVariableNvStore (IN VOID *EmuVariableNvStore)
 

Detailed Description

PlatformInitLib header file.

Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PlatformInitLib.h.

Function Documentation

◆ PlatformAddIoMemoryBaseSizeHob()

VOID EFIAPI PlatformAddIoMemoryBaseSizeHob ( IN EFI_PHYSICAL_ADDRESS  MemoryBase,
IN UINT64  MemorySize 
)

Definition at line 45 of file Platform.c.

◆ PlatformAddIoMemoryRangeHob()

VOID EFIAPI PlatformAddIoMemoryRangeHob ( IN EFI_PHYSICAL_ADDRESS  MemoryBase,
IN EFI_PHYSICAL_ADDRESS  MemoryLimit 
)

Definition at line 88 of file Platform.c.

◆ PlatformAddMemoryBaseSizeHob()

VOID EFIAPI PlatformAddMemoryBaseSizeHob ( IN EFI_PHYSICAL_ADDRESS  MemoryBase,
IN UINT64  MemorySize 
)

Definition at line 98 of file Platform.c.

◆ PlatformAddMemoryRangeHob()

VOID EFIAPI PlatformAddMemoryRangeHob ( IN EFI_PHYSICAL_ADDRESS  MemoryBase,
IN EFI_PHYSICAL_ADDRESS  MemoryLimit 
)

Definition at line 119 of file Platform.c.

◆ PlatformAddReservedMemoryBaseSizeHob()

VOID EFIAPI PlatformAddReservedMemoryBaseSizeHob ( IN EFI_PHYSICAL_ADDRESS  MemoryBase,
IN UINT64  MemorySize,
IN BOOLEAN  Cacheable 
)

Definition at line 63 of file Platform.c.

◆ PlatformAddressWidthInitialization()

VOID EFIAPI PlatformAddressWidthInitialization ( IN OUT EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Initialize the PhysMemAddressWidth field in PlatformInfoHob based on guest RAM size.

Definition at line 1045 of file MemDetect.c.

◆ PlatformCmosRead8()

UINT8 EFIAPI PlatformCmosRead8 ( IN UINTN  Index)

Reads 8-bits of CMOS data.

Reads the 8-bits of CMOS data at the location specified by Index. The 8-bit read value is returned.

Parameters
IndexThe CMOS location to read.
Returns
The value read.

Definition at line 26 of file Cmos.c.

◆ PlatformCmosWrite8()

UINT8 EFIAPI PlatformCmosWrite8 ( IN UINTN  Index,
IN UINT8  Value 
)

Writes 8-bits of CMOS data.

Writes 8-bits of CMOS data to the location specified by Index with the value specified by Value and returns Value.

Parameters
IndexThe CMOS location to write.
ValueThe value to write to CMOS.
Returns
The value written to CMOS.

Definition at line 48 of file Cmos.c.

◆ PlatformDebugDumpCmos()

VOID EFIAPI PlatformDebugDumpCmos ( VOID  )

Dump the CMOS content

Definition at line 63 of file Cmos.c.

◆ PlatformGetSystemMemorySizeBelow4gb()

VOID EFIAPI PlatformGetSystemMemorySizeBelow4gb ( IN EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Definition at line 441 of file MemDetect.c.

◆ PlatformInitEmuVariableNvStore()

EFI_STATUS EFIAPI PlatformInitEmuVariableNvStore ( IN VOID *  EmuVariableNvStore)

When OVMF is lauched with -bios parameter, UEFI variables will be partially emulated, and non-volatile variables may lose their contents after a reboot. This makes the secure boot feature not working.

This function is used to initialize the EmuVariableNvStore with the conent in PcdOvmfFlashNvStorageVariableBase.

Parameters
[in]EmuVariableNvStore- A pointer to EmuVariableNvStore
Return values
EFI_SUCCESS- Successfully init the EmuVariableNvStore
Others- As the error code indicates

Definition at line 933 of file Platform.c.

◆ PlatformMaxCpuCountInitialization()

VOID EFIAPI PlatformMaxCpuCountInitialization ( IN OUT EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Fetch the boot CPU count and the possible CPU count from QEMU, and expose them to UefiCpuPkg modules.

Definition at line 560 of file Platform.c.

◆ PlatformMemMapInitialization()

VOID EFIAPI PlatformMemMapInitialization ( IN OUT EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Definition at line 129 of file Platform.c.

◆ PlatformMiscInitialization()

VOID EFIAPI PlatformMiscInitialization ( IN EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Definition at line 316 of file Platform.c.

◆ PlatformNoexecDxeInitialization()

EFI_STATUS EFIAPI PlatformNoexecDxeInitialization ( IN OUT EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Fetch "opt/ovmf/PcdSetNxForStack" from QEMU

Parameters
SettingThe pointer to the setting of "/opt/ovmf/PcdSetNxForStack".
Returns
EFI_SUCCESS Successfully fetch the settings.

Definition at line 261 of file Platform.c.

◆ PlatformQemuInitializeRam()

VOID EFIAPI PlatformQemuInitializeRam ( IN EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Peform Memory Detection for QEMU / KVM

Definition at line 1231 of file MemDetect.c.

◆ PlatformQemuInitializeRamForS3()

VOID EFIAPI PlatformQemuInitializeRamForS3 ( IN EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Definition at line 1358 of file MemDetect.c.

◆ PlatformQemuUc32BaseInitialization()

VOID EFIAPI PlatformQemuUc32BaseInitialization ( IN OUT EFI_HOB_PLATFORM_INFO PlatformInfoHob)

Definition at line 53 of file MemDetect.c.

◆ PlatformReserveEmuVariableNvStore()

VOID *EFIAPI PlatformReserveEmuVariableNvStore ( VOID  )

Allocate storage for NV variables early on so it will be at a consistent address. Since VM memory is preserved across reboots, this allows the NV variable storage to survive a VM reboot.

Return values
VOID*The pointer to the storage for NV Variables

Definition at line 890 of file Platform.c.

◆ PlatformTdxPublishRamRegions()

VOID EFIAPI PlatformTdxPublishRamRegions ( VOID  )

In Tdx guest, the system memory is passed in TdHob by host VMM. So the major task of PlatformTdxPublishRamRegions is to walk thru the TdHob list and transfer the ResourceDescriptorHob and MemoryAllocationHob to the hobs in DXE phase.

MemoryAllocationHob should also be created for Mailbox and Ovmf work area.

Definition at line 146 of file IntelTdx.c.

◆ PlatformValidateNvVarStore()

BOOLEAN EFIAPI PlatformValidateNvVarStore ( IN UINT8 *  NvVarStoreBase,
IN UINT32  NvVarStoreSize 
)

Check the integrity of NvVarStore.

Parameters
[in]NvVarStoreBase- A pointer to NvVarStore header
[in]NvVarStoreSize- NvVarStore size
Return values
TRUE- The NvVarStore is valid.
FALSE- The NvVarStore is invalid.

Definition at line 765 of file Platform.c.