Main file for attrib shell level 2 function.\r
\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#include "UefiShellLevel2CommandsLib.h"\r
\r
STATIC CONST SHELL_PARAM_ITEM ResetParamList[] = {\r
- {L"-w", TypeValue},\r
- {L"-s", TypeValue},\r
- {L"-c", TypeValue},\r
- {NULL, TypeMax}\r
+ {L"-w", TypeValue},\r
+ {L"-s", TypeValue},\r
+ {L"-c", TypeValue},\r
+ {L"-fwui", TypeFlag },\r
+ {NULL, TypeMax }\r
};\r
\r
/**\r
CONST CHAR16 *String;\r
CHAR16 *ProblemParam;\r
SHELL_STATUS ShellStatus;\r
+ UINT64 OsIndications;\r
+ UINT32 Attr;\r
+ UINTN DataSize;\r
\r
ShellStatus = SHELL_SUCCESS;\r
ProblemParam = NULL;\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); \r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
+\r
+ if (ShellCommandLineGetFlag (Package, L"-fwui")) {\r
+\r
+ DataSize = sizeof (OsIndications);\r
+ Status = gRT->GetVariable (\r
+ EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, &gEfiGlobalVariableGuid,\r
+ &Attr, &DataSize, &OsIndications\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ if ((OsIndications & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) != 0) {\r
+ DataSize = sizeof (OsIndications);\r
+ Status = gRT->GetVariable (\r
+ EFI_OS_INDICATIONS_VARIABLE_NAME, &gEfiGlobalVariableGuid,\r
+ &Attr, &DataSize, &OsIndications\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ OsIndications |= EFI_OS_INDICATIONS_BOOT_TO_FW_UI;\r
+ } else {\r
+ OsIndications = EFI_OS_INDICATIONS_BOOT_TO_FW_UI;\r
+ }\r
+ Status = gRT->SetVariable (\r
+ EFI_OS_INDICATIONS_VARIABLE_NAME, &gEfiGlobalVariableGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ sizeof (OsIndications), &OsIndications\r
+ );\r
+ }\r
+ }\r
+ if (EFI_ERROR (Status)) {\r
+ ShellStatus = SHELL_UNSUPPORTED;\r
+ goto Error;\r
+ }\r
+ }\r
+\r
//\r
// check for warm reset flag, then shutdown reset flag, then cold (default) reset flag\r
//\r
// as the ResetSystem function should not return...\r
//\r
\r
+Error:\r
//\r
// free the command line package\r
//\r