diff options
author | Tomas Pilar <Tomas.Pilar@arm.com> | 2020-06-19 12:59:54 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-06-30 01:39:50 +0000 |
commit | db77d8f7ee9490138d853c4fb06e7a1e14a49148 (patch) | |
tree | d34d90a4ce88b647c6779e3b3774730d1dc9a438 /ShellPkg/Library | |
parent | d45cf5ffdf65f6bfdde64886746d81a69ae31bf4 (diff) | |
download | edk2-db77d8f7ee9490138d853c4fb06e7a1e14a49148.tar.gz edk2-db77d8f7ee9490138d853c4fb06e7a1e14a49148.tar.bz2 edk2-db77d8f7ee9490138d853c4fb06e7a1e14a49148.zip |
ShellPkg: Add AcpiViewCommandLib
The UefiShellAcpiViewCommandLib is converted from NULL library to a
named library so that it may be used in modules other than shell.
The library interface exposes the main method for to AcpiView
functionality as well as a helper method to dump a buffer to a file.
The Shell module is still built by pulling UefiShellAcpiViewCommandLib
as a NULL library to preserve the modularity of shell builds.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
Diffstat (limited to 'ShellPkg/Library')
4 files changed, 3 insertions, 49 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index d2240b2e89..9a5b013fb2 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -17,11 +17,11 @@ #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/AcpiViewCommandLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiView.h"
#include "AcpiViewConfig.h"
-#include "UefiShellAcpiViewCommandLib.h"
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
#include "Arm/SbbrValidator.h"
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c index e6a65d5bc5..d2f26ff89f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c @@ -16,13 +16,13 @@ #include <Library/ShellLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
+#include <Library/AcpiViewCommandLib.h>
#include <Uefi.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiView.h"
#include "AcpiViewConfig.h"
-#include "UefiShellAcpiViewCommandLib.h"
CONST CHAR16 gShellAcpiViewFileName[] = L"ShellCommand";
EFI_HII_HANDLE gShellAcpiViewHiiHandle = NULL;
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.h deleted file mode 100644 index b1b1ffe63e..0000000000 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.h +++ /dev/null @@ -1,45 +0,0 @@ -/** @file
- Header file for 'acpiview' Shell command functions.
-
- Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_
-#define UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_
-
-/**
- Dump a buffer to a file. Print error message if a file cannot be created.
-
- @param[in] FileName The filename that shall be created to contain the buffer.
- @param[in] Buffer Pointer to buffer that shall be dumped.
- @param[in] BufferSize The size of buffer to be dumped in bytes.
-
- @return The number of bytes that were written
-**/
-UINTN
-EFIAPI
-ShellDumpBufferToFile (
- IN CONST CHAR16* FileNameBuffer,
- IN CONST VOID* Buffer,
- IN CONST UINTN BufferSize
- );
-
-/**
- Function for 'acpiview' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if internal).
- @param[in] SystemTable Pointer to the System Table (NULL if internal).
-
- @retval SHELL_INVALID_PARAMETER The command line invocation could not be parsed
- @retval SHELL_NOT_FOUND The command failed
- @retval SHELL_SUCCESS The command was successful
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAcpiView (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif // UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf index 92de2391b0..91459f9ec6 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf @@ -14,7 +14,7 @@ FILE_GUID = FB5B305E-84F5-461F-940D-82D345757AFA
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
+ LIBRARY_CLASS = AcpiViewCommandLib|UEFI_APPLICATION UEFI_DRIVER
CONSTRUCTOR = UefiShellAcpiViewCommandLibConstructor
DESTRUCTOR = UefiShellAcpiViewCommandLibDestructor
@@ -46,7 +46,6 @@ Parsers/Ssdt/SsdtParser.c
Parsers/Xsdt/XsdtParser.c
UefiShellAcpiViewCommandLib.c
- UefiShellAcpiViewCommandLib.h
UefiShellAcpiViewCommandLib.uni
[Sources.ARM, Sources.AARCH64]
|