summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2020-03-25 17:39:23 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-06 17:00:57 +0000
commitf793bfcae94ffe81537967ac2ce3f83a56f3e73a (patch)
tree7eb00efecef7e419739279bf7f0ceee3e8c8a57c /ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h
parent8af507c1f16d9cc311e83397881016e3887acfbb (diff)
downloadedk2-f793bfcae94ffe81537967ac2ce3f83a56f3e73a.tar.gz
edk2-f793bfcae94ffe81537967ac2ce3f83a56f3e73a.tar.bz2
edk2-f793bfcae94ffe81537967ac2ce3f83a56f3e73a.zip
ShellPkg: acpiview: Add library for SBBR ACPI requirements validation
For Arm-based platforms, define and implement an interface for Server Base Boot Requirements (SBBR) compliance checks. The library is responsible for validating that all mandatory ACPI tables are installed on the platform. Internally, the library maintains a data structure which tracks instance counts for ACPI tables which are labeled as 'mandatory' in any SBBR specification version. The provided interface allows: - resetting all instance counts to 0 - incremementing the instance count for a table with a given signature - validating the instance counts against the requirements in SBBR The ACPI table requirements for each SBBR spec version are represented internally as a list of table signatures. Every missing mandatory table (for the input SBBR version) is reported to the user as a separate error. If all requirements are met, an info message is displayed. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h
new file mode 100644
index 0000000000..3135f74fcb
--- /dev/null
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h
@@ -0,0 +1,91 @@
+/** @file
+ Header file for SbbrValidator.c
+
+ Copyright (c) 2020, ARM Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Glossary:
+ - Sbbr or SBBR - Server Base Boot Requirements
+ - Sbsa or SBSA - Server Base System Architecture
+
+ @par Reference(s):
+ - Arm Server Base Boot Requirements 1.2, September 2019
+ - Arm Server Base Boot Requirements 1.1, May 2018
+ - Arm Server Base Boot Requirements 1.0, March 2016
+ - Arm Server Base System Architecture 6.0
+**/
+
+#ifndef SBBR_VALIDATOR_H_
+#define SBBR_VALIDATOR_H_
+
+#include <IndustryStandard/Acpi.h>
+
+/**
+ Arm SBBR specification versions.
+**/
+typedef enum {
+ ArmSbbrVersion_1_0 = 0,
+ ArmSbbrVersion_1_1 = 1,
+ ArmSbbrVersion_1_2 = 2,
+ ArmSbbrVersionMax = 3
+} ARM_SBBR_VERSION;
+
+/**
+ The ACPI table instance counter.
+**/
+typedef struct AcpiTableCounter {
+ CONST UINT32 Signature; /// ACPI table signature
+ UINT32 Count; /// Instance count
+} ACPI_TABLE_COUNTER;
+
+/**
+ ACPI table SBBR requirements.
+**/
+typedef struct AcpiSbbrReq {
+ CONST UINT32* Tables; /// List of required tables
+ CONST UINT32 TableCount; /// Number of elements in Tables
+} ACPI_SBBR_REQ;
+
+/**
+ Reset the platform ACPI table instance count for all SBBR-mandatory tables.
+**/
+VOID
+EFIAPI
+ArmSbbrResetTableCounts (
+ VOID
+ );
+
+/**
+ Increment instance count for SBBR-mandatory ACPI table with the given
+ signature.
+
+ @param [in] Signature ACPI table signature.
+
+ @retval TRUE Count incremented successfully.
+ @retval FALSE Table with the input signature not found.
+**/
+BOOLEAN
+EFIAPI
+ArmSbbrIncrementTableCount (
+ UINT32 Signature
+ );
+
+/**
+ Validate that all ACPI tables required by the given SBBR specification
+ version are installed on the platform.
+
+ @param [in] Version SBBR spec version to validate against.
+
+ @retval EFI_SUCCESS All required tables are present.
+ @retval EFI_INVALID_PARAMETER Invalid SBBR version.
+ @retval EFI_NOT_FOUND One or more mandatory tables are missing.
+ @retval EFI_UNSUPPORTED Mandatory ACPI table does not have its
+ instance count tracked.
+**/
+EFI_STATUS
+EFIAPI
+ArmSbbrReqsValidate (
+ ARM_SBBR_VERSION Version
+ );
+
+#endif // SBBR_VALIDATOR_H_