/** @file\r
Provides interface to shell functionality for shell commands and applications.\r
\r
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, 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
FreePool(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->Info);\r
FreePool((EFI_SHELL_FILE_INFO_NO_CONST*)Node);\r
}\r
+ SHELL_FREE_NON_NULL(*ListHead);\r
return EFI_SUCCESS;\r
}\r
\r
return (Status);\r
}\r
\r
+/**\r
+ Function return the number converted from a hex representation of a number.\r
+\r
+ Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid\r
+ result. Use ShellConvertStringToUint64 instead.\r
+\r
+ @param[in] String String representation of a number.\r
+\r
+ @return The unsigned integer result of the conversion.\r
+ @retval (UINTN)(-1) An error occured.\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellHexStrToUintn(\r
+ IN CONST CHAR16 *String\r
+ )\r
+{\r
+ UINT64 RetVal;\r
+\r
+ if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, TRUE, TRUE))) {\r
+ return ((UINTN)RetVal);\r
+ }\r
+ \r
+ return ((UINTN)(-1));\r
+}\r
+\r
/**\r
Function to determine whether a string is decimal or hex representation of a number\r
and return the number converted from the string. Spaces are always skipped.\r
//\r
*Resp = ShellPromptResponseMax;\r
while (*Resp == ShellPromptResponseMax) {\r
+ if (ShellGetExecutionBreakFlag()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
ASSERT_EFI_ERROR(Status);\r
//\r
*Resp = ShellPromptResponseMax;\r
while (*Resp == ShellPromptResponseMax) {\r
+ if (ShellGetExecutionBreakFlag()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
ASSERT_EFI_ERROR(Status);\r
//\r
*Resp = ShellPromptResponseMax;\r
while (*Resp == ShellPromptResponseMax) {\r
+ if (ShellGetExecutionBreakFlag()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
if (Type == ShellPromptResponseTypeEnterContinue) {\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
//\r
*Resp = ShellPromptResponseMax;\r
while (*Resp == ShellPromptResponseMax) {\r
+ if (ShellGetExecutionBreakFlag()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
ASSERT_EFI_ERROR(Status);\r
ShellPrintEx(-1, -1, L"%s", Prompt);\r
}\r
while(1) {\r
+ if (ShellGetExecutionBreakFlag()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
ASSERT_EFI_ERROR(Status);\r
break;\r
//\r
// This is the location to add new prompt types.\r
+ // If your new type loops remember to add ExecutionBreak support.\r
//\r
default:\r
ASSERT(FALSE);\r