]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/Library/PlatformInitLib.h
OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore
[mirror_edk2.git] / OvmfPkg / Include / Library / PlatformInitLib.h
index 2987a367cc9c8fa06bac931f0633911e644a474d..c5234bf26d45205d175db538841c25bae7fe5a50 100644 (file)
@@ -234,4 +234,55 @@ PlatformTdxPublishRamRegions (
   VOID\r
   );\r
 \r
+/**\r
+  Check the integrity of NvVarStore.\r
+\r
+  @param[in] NvVarStoreBase - A pointer to NvVarStore header\r
+  @param[in] NvVarStoreSize - NvVarStore size\r
+\r
+  @retval  TRUE   - The NvVarStore is valid.\r
+  @retval  FALSE  - The NvVarStore is invalid.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+PlatformValidateNvVarStore (\r
+  IN UINT8   *NvVarStoreBase,\r
+  IN UINT32  NvVarStoreSize\r
+  );\r
+\r
+/**\r
+ Allocate storage for NV variables early on so it will be\r
+ at a consistent address.  Since VM memory is preserved\r
+ across reboots, this allows the NV variable storage to survive\r
+ a VM reboot.\r
+\r
+ *\r
+ * @retval VOID* The pointer to the storage for NV Variables\r
+ */\r
+VOID *\r
+EFIAPI\r
+PlatformReserveEmuVariableNvStore (\r
+  VOID\r
+  );\r
+\r
+/**\r
+ When OVMF is lauched with -bios parameter, UEFI variables will be\r
+ partially emulated, and non-volatile variables may lose their contents\r
+ after a reboot. This makes the secure boot feature not working.\r
+\r
+ This function is used to initialize the EmuVariableNvStore\r
+ with the conent in PcdOvmfFlashNvStorageVariableBase.\r
+\r
+ @param[in] EmuVariableNvStore      - A pointer to EmuVariableNvStore\r
+\r
+ @retval  EFI_SUCCESS   - Successfully init the EmuVariableNvStore\r
+ @retval  Others        - As the error code indicates\r
+ */\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformInitEmuVariableNvStore (\r
+  IN VOID  *EmuVariableNvStore\r
+  );\r
+\r
 #endif // PLATFORM_INIT_LIB_H_\r