aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass2020-07-07 21:32:10 -0600
committerBin Meng2020-07-17 14:32:24 +0800
commit82659cc91014df7dfcc55474c1657d1c9b6fe957 (patch)
tree6f265db5df0bbbb26f89bf67f383aa95e555ae93 /lib
parentfea9651084e72fe94aefa0b828854ef5ce2835b4 (diff)
acpi: Support generation of a scope
Add a function to write a scope to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: Fix build failures on Sandbox] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/acpi/acpigen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/acpi/acpigen.c b/lib/acpi/acpigen.c
index 45216c1f9d6..1e0a489d7b9 100644
--- a/lib/acpi/acpigen.c
+++ b/lib/acpi/acpigen.c
@@ -258,6 +258,13 @@ void acpigen_write_name(struct acpi_ctx *ctx, const char *namepath)
acpigen_emit_namestring(ctx, namepath);
}
+void acpigen_write_scope(struct acpi_ctx *ctx, const char *scope)
+{
+ acpigen_emit_byte(ctx, SCOPE_OP);
+ acpigen_write_len_f(ctx);
+ acpigen_emit_namestring(ctx, scope);
+}
+
static void acpigen_write_method_internal(struct acpi_ctx *ctx,
const char *name, uint flags)
{