/** @file\r
\r
- Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r\r
This program and the accompanying materials are licensed and made available under\r\r
the terms and conditions of the BSD License that accompanies this distribution. \r\r
#include "PlatformBootMode.h"\r
#include <Guid/SetupVariable.h>\r
\r
-#include <Guid/BootState.h>\r
-\r
//\r
// Priority of our boot modes, highest priority first\r
//\r
return Status;\r
}\r
\r
-/**\r
- Check CMOS register bit to determine if previous boot was successful\r
-\r
- @param PeiServices pointer to the PEI Service Table\r
-\r
- @retval TRUE - Previous Boot was success\r
- @retval FALSE - Previous Boot wasn't success\r
-\r
-**/\r
-BOOLEAN\r
-IsPreviousBootSuccessful(\r
- IN CONST EFI_PEI_SERVICES **PeiServices\r
-\r
- )\r
-{\r
- EFI_STATUS Status;\r
- BOOLEAN BootState;\r
- UINTN DataSize;\r
- CHAR16 VarName[] = BOOT_STATE_VARIABLE_NAME;\r
- EFI_PEI_READ_ONLY_VARIABLE2_PPI *PeiVar;\r
-\r
- Status = (**PeiServices).LocatePpi (\r
- PeiServices,\r
- &gEfiPeiReadOnlyVariable2PpiGuid,\r
- 0,\r
- NULL,\r
- (void **)&PeiVar\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Get last Boot State Variable to confirm that it is not a first boot .\r
- //\r
-\r
- DataSize = sizeof (BOOLEAN);\r
- Status = PeiVar->GetVariable (\r
- PeiVar,\r
- VarName,\r
- &gEfiBootStateGuid,\r
- NULL,\r
- &DataSize,\r
- &BootState\r
- );\r
- if (EFI_ERROR (Status) || (BootState == TRUE)) {\r
- return FALSE;\r
- }\r
-\r
- DEBUG ((EFI_D_INFO, "Previous boot cycle successfully completed handover to OS\n"));\r
- return TRUE;\r
-}\r
#ifdef NOCS_S3_SUPPORT\r
EFI_STATUS\r
UpdateBootMode (\r
} // switch (SleepType)\r
}\r
\r
- if (IsFastBootEnabled (PeiServices) && IsPreviousBootSuccessful (PeiServices)) {\r
+ if (IsFastBootEnabled (PeiServices)) {\r
DEBUG ((EFI_D_INFO, "Prioritizing Boot mode to BOOT_WITH_MINIMAL_CONFIGURATION\n"));\r
PrioritizeBootMode (&BootMode, BOOT_WITH_MINIMAL_CONFIGURATION);\r
}\r