]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[mirror_edk2.git] / OvmfPkg / QemuFlashFvbServicesRuntimeDxe / FwBlockService.c
index 0158bf9cd08a5024676aea3f547aadea2375d782..558b395dff4a82c463631a97537098e86bdbad71 100644 (file)
 //\r
 // The protocols, PPI and GUID defintions for this module\r
 //\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
 #include <Protocol/DevicePath.h>\r
+#include <Protocol/FirmwareVolumeBlock.h>\r
 \r
 //\r
 // The Library classes this module consumes\r
 //\r
 #include <Library/BaseLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/DxeServicesTableLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
 \r
 #include "FwBlockService.h"\r
 #include "QemuFlash.h"\r
@@ -645,7 +645,7 @@ FvbProtocolEraseBlocks (
       break;\r
     }\r
 \r
-    NumOfLba = VA_ARG (args, UINT32);\r
+    NumOfLba = VA_ARG (args, UINTN);\r
 \r
     //\r
     // Check input parameters\r
@@ -665,7 +665,7 @@ FvbProtocolEraseBlocks (
       break;\r
     }\r
 \r
-    NumOfLba = VA_ARG (args, UINT32);\r
+    NumOfLba = VA_ARG (args, UINTN);\r
 \r
     while (NumOfLba > 0) {\r
       Status = QemuFlashEraseBlock (StartingLba);\r
@@ -965,6 +965,7 @@ FvbInitialize (
   EFI_PHYSICAL_ADDRESS                BaseAddress;\r
   UINTN                               Length;\r
   UINTN                               NumOfBlocks;\r
+  RETURN_STATUS                       PcdStatus;\r
 \r
   if (EFI_ERROR (QemuFlashInitialize ())) {\r
     //\r
@@ -1095,18 +1096,21 @@ FvbInitialize (
   //\r
   // Set several PCD values to point to flash\r
   //\r
-  PcdSet64 (\r
+  PcdStatus = PcdSet64S (\r
     PcdFlashNvStorageVariableBase64,\r
     (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)\r
     );\r
-  PcdSet32 (\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
+  PcdStatus = PcdSet32S (\r
     PcdFlashNvStorageFtwWorkingBase,\r
     PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)\r
     );\r
-  PcdSet32 (\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
+  PcdStatus = PcdSet32S (\r
     PcdFlashNvStorageFtwSpareBase,\r
     PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)\r
     );\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
     (\r
@@ -1119,6 +1123,7 @@ FvbInitialize (
   //\r
   InstallVirtualAddressChangeHandler ();\r
 \r
-  PcdSetBool (PcdOvmfFlashVariablesEnable, TRUE);\r
+  PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
   return EFI_SUCCESS;\r
 }\r