mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-10-31 03:03:46 +01:00 
			
		
		
		
	ShellPkg: Update Level1 profile commands response output
Updates to Level1 profile commands response output. Updating Level1 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16728 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
							parent
							
								
									bc2807206b
								
							
						
					
					
						commit
						0861edab30
					
				| @ -1,6 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for exit shell level 1 function. | ||||
| 
 | ||||
|   Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -56,7 +57,7 @@ ShellCommandRunExit ( | ||||
|   Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); | ||||
|   if (EFI_ERROR(Status)) { | ||||
|     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"exit", ProblemParam); | ||||
|       FreePool(ProblemParam); | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else { | ||||
| @ -71,7 +72,7 @@ ShellCommandRunExit ( | ||||
|     if (Return != NULL) { | ||||
|       Status = ShellConvertStringToUint64(Return, &RetVal, FALSE, FALSE); | ||||
|       if (EFI_ERROR(Status)) { | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, Return); | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"exit", Return); | ||||
|         ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|       } else { | ||||
|         //
 | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for endfor and for shell level 1 functions. | ||||
| 
 | ||||
|   Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -75,12 +76,12 @@ ShellCommandRunEndFor ( | ||||
|   ASSERT_EFI_ERROR(Status); | ||||
| 
 | ||||
|   if (!gEfiShellProtocol->BatchIsActive()) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"EndFor"); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"endfor"); | ||||
|     return (SHELL_UNSUPPORTED); | ||||
|   } | ||||
| 
 | ||||
|   if (gEfiShellParametersProtocol->Argc > 1) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"endfor"); | ||||
|     return (SHELL_INVALID_PARAMETER); | ||||
|   } | ||||
| 
 | ||||
| @ -323,12 +324,12 @@ ShellCommandRunFor ( | ||||
|   ASSERT_EFI_ERROR(Status); | ||||
| 
 | ||||
|   if (!gEfiShellProtocol->BatchIsActive()) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"For"); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"for"); | ||||
|     return (SHELL_UNSUPPORTED); | ||||
|   } | ||||
| 
 | ||||
|   if (gEfiShellParametersProtocol->Argc < 4) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"for"); | ||||
|     return (SHELL_INVALID_PARAMETER); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for goto shell level 1 function. | ||||
| 
 | ||||
|   Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -58,7 +59,7 @@ ShellCommandRunGoto ( | ||||
|   Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); | ||||
|   if (EFI_ERROR(Status)) { | ||||
|     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"goto", ProblemParam); | ||||
|       FreePool(ProblemParam); | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else { | ||||
| @ -66,10 +67,10 @@ ShellCommandRunGoto ( | ||||
|     } | ||||
|   } else { | ||||
|     if (ShellCommandLineGetRawValue(Package, 2) != NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"goto"); | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"goto"); | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else { | ||||
|       Size = 0; | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for If and else shell level 1 function. | ||||
| 
 | ||||
|   Copyright (c) 2013, Hewlett-Packard Development Company, L.P. | ||||
|   Copyright (c) 2013 - 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -831,12 +831,12 @@ ShellCommandRunIf ( | ||||
|   ASSERT_EFI_ERROR(Status); | ||||
| 
 | ||||
|   if (!gEfiShellProtocol->BatchIsActive()) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"If"); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if");   | ||||
|     return (SHELL_UNSUPPORTED); | ||||
|   } | ||||
| 
 | ||||
|   if (gEfiShellParametersProtocol->Argc < 3) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if");   | ||||
|     return (SHELL_INVALID_PARAMETER); | ||||
|   } | ||||
| 
 | ||||
| @ -914,12 +914,12 @@ ShellCommandRunIf ( | ||||
|       // we are at the then
 | ||||
|       //
 | ||||
|       if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) { | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle); | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if");   | ||||
|         ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|       } else { | ||||
|         Status = PerformResultOperation(CurrentValue); | ||||
|         if (EFI_ERROR(Status)) { | ||||
|           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[CurrentParameter]); | ||||
|           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);   | ||||
|           ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|         } | ||||
|       } | ||||
| @ -957,7 +957,7 @@ ShellCommandRunIf ( | ||||
|           if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) { | ||||
|             Status = PerformResultOperation(CurrentValue); | ||||
|             if (EFI_ERROR(Status)) { | ||||
|               ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[CurrentParameter]); | ||||
|               ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);   | ||||
|               ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|             } | ||||
|             break; | ||||
| @ -995,7 +995,7 @@ ShellCommandRunElse ( | ||||
|   ASSERT_EFI_ERROR(CommandInit()); | ||||
| 
 | ||||
|   if (gEfiShellParametersProtocol->Argc > 1) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");   | ||||
|     return (SHELL_INVALID_PARAMETER); | ||||
|   } | ||||
| 
 | ||||
| @ -1070,7 +1070,7 @@ ShellCommandRunEndIf ( | ||||
|   ASSERT_EFI_ERROR(CommandInit()); | ||||
| 
 | ||||
|   if (gEfiShellParametersProtocol->Argc > 1) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");   | ||||
|     return (SHELL_INVALID_PARAMETER); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for Shift shell level 1 function. | ||||
| 
 | ||||
|   Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -35,7 +36,7 @@ ShellCommandRunShift ( | ||||
|   ASSERT_EFI_ERROR(Status); | ||||
| 
 | ||||
|   if (!gEfiShellProtocol->BatchIsActive()) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"Shift"); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift");   | ||||
|     return (SHELL_UNSUPPORTED); | ||||
|   } | ||||
| 
 | ||||
| @ -43,7 +44,7 @@ ShellCommandRunShift ( | ||||
|   ASSERT(CurrentScriptFile != NULL); | ||||
| 
 | ||||
|   if (CurrentScriptFile->Argc < 2) { | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle); | ||||
|     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift");   | ||||
|     return (SHELL_UNSUPPORTED); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| /** @file
 | ||||
|   Main file for stall shell level 1 function. | ||||
| 
 | ||||
|   Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> | ||||
|   Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> | ||||
|   This program and the accompanying materials | ||||
|   are licensed and made available under the terms and conditions of the BSD License | ||||
| @ -50,7 +51,7 @@ ShellCommandRunStall ( | ||||
|   Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); | ||||
|   if (EFI_ERROR(Status)) { | ||||
|     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"stall", ProblemParam);   | ||||
|       FreePool(ProblemParam); | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else { | ||||
| @ -58,20 +59,20 @@ ShellCommandRunStall ( | ||||
|     } | ||||
|   } else { | ||||
|     if (ShellCommandLineGetRawValue(Package, 2) != NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"stall");   | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) { | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle); | ||||
|       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"stall");   | ||||
|       ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|     } else { | ||||
|       Status = ShellConvertStringToUint64(ShellCommandLineGetRawValue(Package, 1), &Intermediate, FALSE, FALSE); | ||||
|       if (EFI_ERROR(Status) || ((UINT64)(UINTN)(Intermediate)) != Intermediate) { | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel1HiiHandle, ShellCommandLineGetRawValue(Package, 1)); | ||||
|         ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"stall", ShellCommandLineGetRawValue(Package, 1));   | ||||
|         ShellStatus = SHELL_INVALID_PARAMETER; | ||||
|       } else { | ||||
|         Status = gBS->Stall((UINTN)Intermediate); | ||||
|         if (EFI_ERROR(Status)) { | ||||
|           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, Status); | ||||
|           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, L"stall");   | ||||
|           ShellStatus = SHELL_DEVICE_ERROR; | ||||
|         } | ||||
|       } | ||||
|  | ||||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user