From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzM-0003id-GB for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKlzG-0000Un-Bf for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzG-0000Ug-4E for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:42 -0500 From: Igor Mammedov Date: Mon, 9 Feb 2015 10:53:35 +0000 Message-Id: <1423479254-15342-14-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3 13/52] acpi: extend build_append_{value|int}() to support 64-bit values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com it will be used for generating 64bit _CRS entries Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 9 ++++++--- include/hw/acpi/aml-build.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 5d6553c..d71b236 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -219,7 +219,7 @@ void build_extop_package(GArray *package, uint8_t op) build_prepend_byte(package, 0x5B); /* ExtOpPrefix */ } -void build_append_value(GArray *table, uint32_t value, int size) +void build_append_value(GArray *table, uint64_t value, int size) { int i; @@ -229,7 +229,7 @@ void build_append_value(GArray *table, uint32_t value, int size) } } -void build_append_int(GArray *table, uint32_t value) +void build_append_int(GArray *table, uint64_t value) { if (value == 0x00) { build_append_byte(table, 0x00); /* ZeroOp */ @@ -241,9 +241,12 @@ void build_append_int(GArray *table, uint32_t value) } else if (value <= 0xFFFF) { build_append_byte(table, 0x0B); /* WordPrefix */ build_append_value(table, value, 2); - } else { + } else if (value <= 0xFFFFFFFF) { build_append_byte(table, 0x0C); /* DWordPrefix */ build_append_value(table, value, 4); + } else { + build_append_byte(table, 0x0E); /* QWordPrefix */ + build_append_value(table, value, 8); } } diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index d5d8c11..5abc56b 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -95,8 +95,8 @@ build_append_namestring(GArray *array, const char *format, ...); void build_prepend_package_length(GArray *package); void build_package(GArray *package, uint8_t op); -void build_append_value(GArray *table, uint32_t value, int size); -void build_append_int(GArray *table, uint32_t value); +void build_append_value(GArray *table, uint64_t value, int size); +void build_append_int(GArray *table, uint64_t value); void build_extop_package(GArray *package, uint8_t op); #endif -- 1.8.3.1