DynamicTablesPkg: Add AmlGetEisaIdFromString() to AcpiHelperLib

Add a function converting a 7 characters string to its UINT32
EISAID. The algorithm used to create the EISAID is described
in the ACPI 6.4 specification, s19.3.4 "ASL Macros".

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
This commit is contained in:
Pierre Gondois
2021-09-30 08:48:16 +01:00
committed by mergify[bot]
parent 653113412f
commit 72ab552554
2 changed files with 86 additions and 0 deletions

View File

@@ -73,4 +73,21 @@ IsValidAcpiId (
IN CONST CHAR8 * Hid
);
/** Convert a EisaId string to its compressed UINT32 equivalent.
Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
@param [in] EisaIdStr Input EisaId string.
@param [out] EisaIdInt Output EisaId UINT32 (compressed).
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlGetEisaIdFromString (
IN CONST CHAR8 * EisaIdStr,
OUT UINT32 * EisaIdInt
);
#endif // ACPI_HELPER_LIB_H_