Files
edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.c
Michael D Kinney 083b9d645a Platform/ARM: Replace BSD License with BSD+Patent License
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

NOTE: Files with a BSD 3-Clause license are not modified by this patch
      series.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-05-17 14:21:34 -07:00

90 lines
2.3 KiB
C

/** @file
*
* Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/ArmShellCmdLib.h>
#include "ArmShellCmdRunAxf.h"
EFI_HANDLE gRunAxfHiiHandle = NULL;
#define RUNAXF_HII_GUID \
{ \
0xf5a6413b, 0x78d5, 0x448e, { 0xa2, 0x15, 0x22, 0x82, 0x8e, 0xbc, 0x61, 0x61 } \
}
EFI_GUID gRunAxfHiiGuid = RUNAXF_HII_GUID;
static EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mShellDynCmdProtocolRunAxf = {
L"runaxf", // *CommandName
ShellDynCmdRunAxfHandler, // Handler
ShellDynCmdRunAxfGetHelp // GetHelp
};
EFI_STATUS
ShellDynCmdRunAxfInstall (
IN EFI_HANDLE ImageHandle
)
{
EFI_STATUS Status;
// Register our shell command
Status = gBS->InstallMultipleProtocolInterfaces (&ImageHandle,
&gEfiShellDynamicCommandProtocolGuid,
&mShellDynCmdProtocolRunAxf,
NULL);
if (EFI_ERROR (Status)) {
return Status;
}
// Load the manual page for our command
//
// 3rd parameter 'HII strings array' must be name of .uni strings file
// followed by 'Strings', e.g. mycommands.uni must be specified as
// 'mycommandsStrings' because the build Autogen process defines this as a
// string array for the strings in your .uni file. Examine your Build folder
// under your package's DEBUG folder and you will find it defined in a
// xxxStrDefs.h file.
//
gRunAxfHiiHandle = HiiAddPackages (&gRunAxfHiiGuid, ImageHandle,
ArmShellCmdRunAxfStrings, NULL);
if (gRunAxfHiiHandle == NULL) {
return EFI_UNSUPPORTED;
}
return EFI_SUCCESS;
}
EFI_STATUS
ShellDynCmdRunAxfUninstall (
IN EFI_HANDLE ImageHandle
)
{
EFI_STATUS Status;
if (gRunAxfHiiHandle != NULL) {
HiiRemovePackages (gRunAxfHiiHandle);
}
Status = gBS->UninstallMultipleProtocolInterfaces (ImageHandle,
&gEfiShellDynamicCommandProtocolGuid,
&mShellDynCmdProtocolRunAxf,
NULL);
if (EFI_ERROR (Status)) {
return Status;
}
return EFI_SUCCESS;
}