From 39b6dbd8d7bbaa864ce42dcdcffe79313de9f2d6 Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Tue, 1 Mar 2016 18:56:03 +0800 Subject: acpi: add aml_create_field() It will be used by nvdimm acpi Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/hw/acpi') diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index d3e0c8f..7d26911 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -344,6 +344,8 @@ Aml *aml_mutex(const char *name, uint8_t sync_level); Aml *aml_acquire(Aml *mutex, uint16_t timeout); Aml *aml_release(Aml *mutex); Aml *aml_alias(const char *source_object, const char *alias_object); +Aml *aml_create_field(Aml *srcbuf, Aml *bit_index, Aml *num_bits, + const char *name); Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name); Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name); Aml *aml_varpackage(uint32_t num_elements); -- cgit v1.1 From 9815cba5027b0a8732733dc2a908b4e06d6b8ffc Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Tue, 1 Mar 2016 18:56:04 +0800 Subject: acpi: add aml_concatenate() It will be used by nvdimm acpi Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/hw/acpi') diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 7d26911..258cbf3 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -353,6 +353,7 @@ Aml *aml_touuid(const char *uuid); Aml *aml_unicode(const char *str); Aml *aml_derefof(Aml *arg); Aml *aml_sizeof(Aml *arg); +Aml *aml_concatenate(Aml *source1, Aml *source2, Aml *target); void build_header(GArray *linker, GArray *table_data, -- cgit v1.1 From 3f3009c0983428f517b743c9de14858b1fdaacb7 Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Tue, 1 Mar 2016 18:56:05 +0800 Subject: acpi: allow using object as offset for OperationRegion Extend aml_operation_region() to use object as offset Reviewed-by: Igor Mammedov Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/hw/acpi') diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 258cbf3..b16017e 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -285,7 +285,7 @@ Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro, Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base, uint8_t aln, uint8_t len); Aml *aml_operation_region(const char *name, AmlRegionSpace rs, - uint32_t offset, uint32_t len); + Aml *offset, uint32_t len); Aml *aml_irq_no_flags(uint8_t irq); Aml *aml_named_field(const char *name, unsigned length); Aml *aml_reserved_field(unsigned length); -- cgit v1.1 From f20354910893310d5496ebb6edfc551d83d95343 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Tue, 1 Mar 2016 18:56:07 +0800 Subject: acpi: add build_append_named_dword, returning an offset in buffer This is a very limited form of support for runtime patching - similar in functionality to what we can do with ACPI_EXTRACT macros in python, but implemented in C. This is to allow ACPI code direct access to data tables - which is exactly what DataTableRegion is there for, except no known windows release so far implements DataTableRegion. Signed-off-by: Michael S. Tsirkin Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/hw/acpi') diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index b16017e..66f48ec 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -368,4 +368,7 @@ void build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets, const char *oem_id, const char *oem_table_id); +int +build_append_named_dword(GArray *array, const char *name_format, ...); + #endif -- cgit v1.1