3 * Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
5 * This program and the accompanying materials are licensed and made available
6 * under the terms and conditions of the BSD License which accompanies this
7 * distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/BaseLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/UefiLib.h>
20 #include <Library/ArmShellCmdLib.h>
22 #include "ArmShellCmdRunAxf.h"
24 EFI_HANDLE gRunAxfHiiHandle
= NULL
;
26 #define RUNAXF_HII_GUID \
28 0xf5a6413b, 0x78d5, 0x448e, { 0xa2, 0x15, 0x22, 0x82, 0x8e, 0xbc, 0x61, 0x61 } \
31 EFI_GUID gRunAxfHiiGuid
= RUNAXF_HII_GUID
;
33 static EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mShellDynCmdProtocolRunAxf
= {
34 L
"runaxf", // *CommandName
35 ShellDynCmdRunAxfHandler
, // Handler
36 ShellDynCmdRunAxfGetHelp
// GetHelp
40 ShellDynCmdRunAxfInstall (
41 IN EFI_HANDLE ImageHandle
46 // Register our shell command
47 Status
= gBS
->InstallMultipleProtocolInterfaces (&ImageHandle
,
48 &gEfiShellDynamicCommandProtocolGuid
,
49 &mShellDynCmdProtocolRunAxf
,
51 if (EFI_ERROR (Status
)) {
55 // Load the manual page for our command
57 // 3rd parameter 'HII strings array' must be name of .uni strings file
58 // followed by 'Strings', e.g. mycommands.uni must be specified as
59 // 'mycommandsStrings' because the build Autogen process defines this as a
60 // string array for the strings in your .uni file. Examine your Build folder
61 // under your package's DEBUG folder and you will find it defined in a
64 gRunAxfHiiHandle
= HiiAddPackages (&gRunAxfHiiGuid
, ImageHandle
,
65 ArmShellCmdRunAxfStrings
, NULL
);
66 if (gRunAxfHiiHandle
== NULL
) {
67 return EFI_UNSUPPORTED
;
75 ShellDynCmdRunAxfUninstall (
76 IN EFI_HANDLE ImageHandle
82 if (gRunAxfHiiHandle
!= NULL
) {
83 HiiRemovePackages (gRunAxfHiiHandle
);
86 Status
= gBS
->UninstallMultipleProtocolInterfaces (ImageHandle
,
87 &gEfiShellDynamicCommandProtocolGuid
,
88 &mShellDynCmdProtocolRunAxf
,
90 if (EFI_ERROR (Status
)) {