summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2021-09-30 08:48:16 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-10-01 10:57:43 +0000
commit72ab55255478a8c87f670e12d9e4475279759137 (patch)
tree0a52b6a34dd3640f659b219eb6345e6246f532fe /DynamicTablesPkg/Include
parent653113412fe1099bc80bc128f6501ea77631cc0e (diff)
downloadedk2-72ab55255478a8c87f670e12d9e4475279759137.tar.gz
edk2-72ab55255478a8c87f670e12d9e4475279759137.tar.bz2
edk2-72ab55255478a8c87f670e12d9e4475279759137.zip
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>
Diffstat (limited to 'DynamicTablesPkg/Include')
-rw-r--r--DynamicTablesPkg/Include/Library/AcpiHelperLib.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Include/Library/AcpiHelperLib.h b/DynamicTablesPkg/Include/Library/AcpiHelperLib.h
index 094392a1a6..a93e95e919 100644
--- a/DynamicTablesPkg/Include/Library/AcpiHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/AcpiHelperLib.h
@@ -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_