Skip to content

Commit

Permalink
acpi: add aml_processor() term
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Igor Mammedov authored and mstsirkin committed Feb 26, 2015
1 parent 15e44e5 commit 3dd1564
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hw/acpi/aml-build.c
Expand Up @@ -650,3 +650,18 @@ Aml *aml_varpackage(uint32_t num_elements)
build_append_int(var->buf, num_elements);
return var;
}

/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefProcessor */
Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len,
const char *name_format, ...)
{
va_list ap;
Aml *var = aml_bundle(0x83 /* ProcessorOp */, AML_EXT_PACKAGE);
va_start(ap, name_format);
build_append_namestringv(var->buf, name_format, ap);
va_end(ap);
build_append_byte(var->buf, proc_id); /* ProcID */
build_append_int_noprefix(var->buf, pblk_addr, sizeof(pblk_addr));
build_append_byte(var->buf, pblk_len); /* PblkLen */
return var;
}
2 changes: 2 additions & 0 deletions include/hw/acpi/aml-build.h
Expand Up @@ -94,6 +94,8 @@ Aml *aml_named_field(const char *name, unsigned length);
Aml *aml_local(int num);
Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Aml *aml_equal(Aml *arg1, Aml *arg2);
Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len,
const char *name_format, ...) GCC_FMT_ATTR(4, 5);

/* Block AML object primitives */
Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Expand Down

0 comments on commit 3dd1564

Please sign in to comment.