TianoCore EDK2 master
Loading...
Searching...
No Matches
TableHelperLib.h File Reference

Go to the source code of this file.

Typedefs

typedef BOOLEAN(EFIAPI * PFN_IS_EQUAL) (IN CONST VOID *Object1, IN CONST VOID *Object2, IN UINTN Index1 OPTIONAL, IN UINTN Index2 OPTIONAL)
 

Functions

EFI_STATUS EFIAPI GetCgfMgrInfo (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT CM_STD_OBJ_CONFIGURATION_MANAGER_INFO **CfgMfrInfo)
 
EFI_STATUS EFIAPI AddAcpiHeader (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER *CONST AcpiHeader, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST UINT32 Length)
 
EFI_STATUS EFIAPI AddSsdtAcpiHeader (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, OUT AML_ROOT_NODE_HANDLE *RootNode)
 
BOOLEAN EFIAPI FindDuplicateValue (IN CONST VOID *Array, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN PFN_IS_EQUAL EqualTestFunction)
 
VOID EFIAPI ParseCmObjDesc (IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc)
 

Detailed Description

Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Glossary:
  • PFN - Pointer to a Function

Definition in file TableHelperLib.h.

Typedef Documentation

◆ PFN_IS_EQUAL

typedef BOOLEAN(EFIAPI * PFN_IS_EQUAL) (IN CONST VOID *Object1, IN CONST VOID *Object2, IN UINTN Index1 OPTIONAL, IN UINTN Index2 OPTIONAL)

Function prototype for testing if two arbitrary objects are equal.

Parameters
[in]Object1Pointer to the first object to compare.
[in]Object2Pointer to the second object to compare.
[in]Index1Index of Object1. This value is optional and can be ignored by the specified implementation.
[in]Index2Index of Object2. This value is optional and can be ignored by the specified implementation.
Return values
TRUEObject1 and Object2 are equal.
FALSEObject1 and Object2 are NOT equal.

Definition at line 114 of file TableHelperLib.h.

Function Documentation

◆ AddAcpiHeader()

EFI_STATUS EFIAPI AddAcpiHeader ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN CONST ACPI_TABLE_GENERATOR *CONST  Generator,
IN OUT EFI_ACPI_DESCRIPTION_HEADER *CONST  AcpiHeader,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST  AcpiTableInfo,
IN CONST UINT32  Length 
)

The AddAcpiHeader function updates the ACPI header structure. It uses the ACPI table Generator and the Configuration Manager protocol to obtain the information required for constructing the header.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager protocol interface.
[in]GeneratorPointer to the ACPI table Generator.
[in,out]AcpiHeaderPointer to the ACPI table header to be updated.
[in]AcpiTableInfoPointer to the ACPI table info structure.
[in]LengthLength of the ACPI table.
Return values
EFI_SUCCESSThe ACPI table is updated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object information is not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

The AddAcpiHeader function updates the ACPI header structure pointed by the AcpiHeader. It utilizes the ACPI table Generator and the Configuration Manager protocol to obtain any information required for constructing the header.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager protocol interface.
[in]GeneratorPointer to the ACPI table Generator.
[in,out]AcpiHeaderPointer to the ACPI table header to be updated.
[in]AcpiTableInfoPointer to the ACPI table info structure.
[in]LengthLength of the ACPI table.
Return values
EFI_SUCCESSThe ACPI table is updated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object information is not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 114 of file TableHelper.c.

◆ AddSsdtAcpiHeader()

EFI_STATUS EFIAPI AddSsdtAcpiHeader ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN CONST ACPI_TABLE_GENERATOR *CONST  Generator,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST  AcpiTableInfo,
OUT AML_ROOT_NODE_HANDLE RootNode 
)

Build a RootNode containing SSDT ACPI header information using the AmlLib.

The function utilizes the ACPI table Generator and the Configuration Manager protocol to obtain any information required for constructing the header. It then creates a RootNode. The SSDT ACPI header is part of the RootNode.

This is essentially a wrapper around AmlCodeGenDefinitionBlock () from the AmlLib.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager protocol interface.
[in]GeneratorPointer to the ACPI table Generator.
[in]AcpiTableInfoPointer to the ACPI table info structure.
[out]RootNodeIf success, contains the created RootNode. The SSDT ACPI header is part of the RootNode.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object information is not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 221 of file TableHelper.c.

◆ FindDuplicateValue()

BOOLEAN EFIAPI FindDuplicateValue ( IN CONST VOID *  Array,
IN CONST UINTN  Count,
IN CONST UINTN  ElementSize,
IN PFN_IS_EQUAL  EqualTestFunction 
)

Test and report if a duplicate entry exists in the given array of comparable elements.

Parameters
[in]ArrayArray of elements to test for duplicates.
[in]CountNumber of elements in Array.
[in]ElementSizeSize of an element in bytes
[in]EqualTestFunctionThe function to call to check if any two elements are equal.
Return values
TRUEA duplicate element was found or one of the input arguments is invalid.
FALSEEvery element in Array is unique.

Definition at line 299 of file TableHelper.c.

◆ GetCgfMgrInfo()

EFI_STATUS EFIAPI GetCgfMgrInfo ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
OUT CM_STD_OBJ_CONFIGURATION_MANAGER_INFO **  CfgMfrInfo 
)

The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO object from the Configuration Manager.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager protocol interface.
[out]CfgMfrInfoPointer to the Configuration Manager Info object structure.
Return values
EFI_SUCCESSThe object is returned.
EFI_INVALID_PARAMETERThe Object ID is invalid.
EFI_NOT_FOUNDThe requested Object is not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size.

Definition at line 38 of file TableHelper.c.

◆ ParseCmObjDesc()

VOID EFIAPI ParseCmObjDesc ( IN CONST CM_OBJ_DESCRIPTOR CmObjDesc)

Parse and print a CmObjDesc.

Parameters
[in]CmObjDescThe CmObjDesc to parse and print.

Definition at line 1156 of file ConfigurationManagerObjectParser.c.