acpi: add aml_resource_template() helper

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>
This commit is contained in:
Igor Mammedov 2015-02-18 19:14:31 +00:00 committed by Michael S. Tsirkin
parent 04b8da543d
commit ad4a80bc6f
2 changed files with 9 additions and 0 deletions

View File

@ -506,6 +506,14 @@ Aml *aml_device(const char *name_format, ...)
return var; return var;
} }
/* ACPI 1.0b: 6.4.1 ASL Macros for Resource Descriptors */
Aml *aml_resource_template(void)
{
/* ResourceTemplate is a buffer of Resources with EndTag at the end */
Aml *var = aml_bundle(0x11 /* BufferOp */, AML_RES_TEMPLATE);
return var;
}
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefBuffer */ /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefBuffer */
Aml *aml_buffer(void) Aml *aml_buffer(void)
{ {

View File

@ -80,6 +80,7 @@ Aml *aml_method(const char *name, int arg_count);
Aml *aml_if(Aml *predicate); Aml *aml_if(Aml *predicate);
Aml *aml_package(uint8_t num_elements); Aml *aml_package(uint8_t num_elements);
Aml *aml_buffer(void); Aml *aml_buffer(void);
Aml *aml_resource_template(void);
/* other helpers */ /* other helpers */
GArray *build_alloc_array(void); GArray *build_alloc_array(void);