From 29df845204e6b67583491b3c9883432c3a74d923 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 7 Jul 2020 13:11:55 -0600 Subject: acpi: Support writing a UUID ACPI supports writing a UUID in a special format. Add a function to handle this. Signed-off-by: Simon Glass Reviewed-by: Wolfgang Wallner Reviewed-by: Bin Meng --- include/acpi/acpigen.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/acpi/acpigen.h') diff --git a/include/acpi/acpigen.h b/include/acpi/acpigen.h index 24aec7fad6..31fa20a806 100644 --- a/include/acpi/acpigen.h +++ b/include/acpi/acpigen.h @@ -27,6 +27,7 @@ enum { DWORD_PREFIX = 0x0c, STRING_PREFIX = 0x0d, QWORD_PREFIX = 0x0e, + BUFFER_OP = 0x11, PACKAGE_OP = 0x12, DUAL_NAME_PREFIX = 0x2e, MULTI_NAME_PREFIX = 0x2f, @@ -190,4 +191,16 @@ void acpigen_emit_namestring(struct acpi_ctx *ctx, const char *namepath); * @namepath: Name / path to emit */ void acpigen_write_name(struct acpi_ctx *ctx, const char *namepath); + +/** + * acpigen_write_uuid() - Write a UUID + * + * This writes out a UUID in the format used by ACPI, with a BUFFER_OP prefix. + * + * @ctx: ACPI context pointer + * @uuid: UUID to write in the form aabbccdd-eeff-gghh-iijj-kkllmmnnoopp + * @return 0 if OK, -EINVAL if the format is incorrect + */ +int acpigen_write_uuid(struct acpi_ctx *ctx, const char *uuid); + #endif -- cgit