summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-04-20 16:08:22 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-04-23 17:52:44 +0800
commitee4dc24f57c32a445e7c747396c9bfbd8b221568 (patch)
treea332a4c461762cf555bc62b4eb9930f1bb4888fa /ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
parent8b5c80e0296c7050348a6a89f2cef66190c6141d (diff)
downloadedk2-ee4dc24f57c32a445e7c747396c9bfbd8b221568.tar.gz
edk2-ee4dc24f57c32a445e7c747396c9bfbd8b221568.tar.bz2
edk2-ee4dc24f57c32a445e7c747396c9bfbd8b221568.zip
ShellPkg: Add acpiview tool to dump ACPI tables
This program is provided to allow examination of ACPI table contents from the UEFI Shell. This can help with investigations, especially at that stage where the tables are not enabling an OS to boot. The program is not exhaustive, and only encapsulates detailed knowledge of a limited number of table types. Default behaviour is to display the content of all tables installed. 'Known' table types will be parsed and displayed with descriptions and field values. Where appropriate a degree of consistency checking is done and errors may be reported in the output. Other table types will be displayed as an array of Hexadecimal bytes. To facilitate debugging, the -s and -d options can be used to generate a binary file image of a table that can be copied elsewhere for investigation using tools such as those provided by acpica.org. This is especially relevant for AML type tables like DSDT and SSDT. The inspiration for this is the existing smbiosview Debug1 Shell command. Many tables are not explicitly handled, in part because no examples are available for our testing. The program is designed to be extended to new tables with minimal effort, and contributions are invited. Change-Id: Ifa23dc80ab8ab042c56e88424847e796a8122a7c Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
new file mode 100644
index 0000000000..03561ea816
--- /dev/null
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
@@ -0,0 +1,103 @@
+/**
+ Header file for AcpiView
+
+ Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef ACPIVIEW_H_
+#define ACPIVIEW_H_
+
+/** A macro to define the max file name length
+*/
+#define MAX_FILE_NAME_LEN 128
+
+/** Offset to the RSDP revision from the start of the RSDP
+*/
+#define RSDP_REVISION_OFFSET 15
+
+/** Offset to the RSDP length from the start of the RSDP
+*/
+#define RSDP_LENGTH_OFFSET 20
+
+/** The EREPORT_OPTION enum describes ACPI table Reporting options.
+*/
+typedef enum ReportOption {
+ EREPORT_ALL, ///< Report All tables.
+ EREPORT_SELECTED, ///< Report Selected table.
+ EREPORT_TABLE_LIST, ///< Report List of tables.
+ EREPORT_DUMP_BIN_FILE, ///< Dump selected table to a file.
+ EREPORT_MAX
+} EREPORT_OPTION;
+
+/** This function resets the ACPI table error counter to Zero.
+*/
+VOID
+ResetErrorCount (
+ VOID
+ );
+
+/** This function returns the ACPI table error count.
+
+ @retval Returns the count of errors detected in the ACPI tables.
+*/
+UINT32
+GetErrorCount (
+ VOID
+ );
+
+/** This function resets the ACPI table warning counter to Zero.
+*/
+VOID
+ResetWarningCount (
+ VOID
+ );
+
+/** This function returns the ACPI table warning count.
+
+ @retval Returns the count of warning detected in the ACPI tables.
+*/
+UINT32
+GetWarningCount (
+ VOID
+ );
+
+/** This function returns the colour highlighting status.
+
+ @retval TRUE if colour highlighting is enabled.
+*/
+BOOLEAN
+GetColourHighlighting (
+ VOID
+ );
+
+/** This function sets the colour highlighting status.
+
+*/
+VOID
+SetColourHighlighting (
+ BOOLEAN Highlight
+ );
+
+/** This function processes the table reporting options for the ACPI table.
+
+ @param [in] Signature The ACPI table Signature.
+ @param [in] TablePtr Pointer to the ACPI table data.
+ @param [in] Length The length fo the ACPI table.
+
+ @retval Returns TRUE if the ACPI table should be traced.
+*/
+BOOLEAN
+ProcessTableReportOptions (
+ IN CONST UINT32 Signature,
+ IN CONST UINT8* TablePtr,
+ IN CONST UINT32 Length
+ );
+
+#endif // ACPIVIEW_H_