OvmfPkg/PlatformPei: Add mBootMode driver variable
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15291 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index a74d353..3e69d92 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -59,6 +59,9 @@
};
+EFI_BOOT_MODE mBootMode = BOOT_WITH_FULL_CONFIGURATION;
+
+
VOID
AddIoMemoryBaseSizeHob (
EFI_PHYSICAL_ADDRESS MemoryBase,
@@ -269,16 +272,13 @@
VOID
)
{
- EFI_BOOT_MODE BootMode;
EFI_STATUS Status;
if (CmosRead8 (0xF) == 0xFE) {
- BootMode = BOOT_ON_S3_RESUME;
- } else {
- BootMode = BOOT_WITH_FULL_CONFIGURATION;
+ mBootMode = BOOT_ON_S3_RESUME;
}
- Status = PeiServicesSetBootMode (BootMode);
+ Status = PeiServicesSetBootMode (mBootMode);
ASSERT_EFI_ERROR (Status);
Status = PeiServicesInstallPpi (mPpiBootMode);
diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h
index 5cce796..9ed712f 100644
--- a/OvmfPkg/PlatformPei/Platform.h
+++ b/OvmfPkg/PlatformPei/Platform.h
@@ -96,4 +96,6 @@
VOID
);
+extern EFI_BOOT_MODE mBootMode;
+
#endif // _PLATFORM_PEI_H_INCLUDED_