From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEJ5u-0002Z9-F4 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 09:50:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEJ5t-0003SG-82 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 09:50:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEJ5s-0003RE-T0 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 09:50:49 -0500 From: Igor Mammedov Date: Thu, 22 Jan 2015 14:49:48 +0000 Message-Id: <1421938231-25698-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1421938231-25698-1-git-send-email-imammedo@redhat.com> References: <1421938231-25698-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v2 04/47] acpi: add acpi_method() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com Signed-off-by: Igor Mammedov --- hw/acpi/acpi-build-utils.c | 9 +++++++++ include/hw/acpi/acpi-build-utils.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/acpi/acpi-build-utils.c b/hw/acpi/acpi-build-utils.c index 289f1e3..d0b0159 100644 --- a/hw/acpi/acpi-build-utils.c +++ b/hw/acpi/acpi-build-utils.c @@ -314,6 +314,15 @@ static AcpiAml aml_allocate_internal(uint8_t op, AcpiBlockFlags flags) return var; } +/* ACPI 5.0: 20.2.5.2 Named Objects Encoding: DefMethod */ +AcpiAml acpi_method(const char *name, int arg_count) +{ + AcpiAml var = aml_allocate_internal(0x14 /* MethodOp */, PACKAGE); + build_append_namestring(var.buf, "%s", name); + build_append_byte(var.buf, arg_count); /* MethodFlags: ArgCount */ + return var; +} + /* ACPI 5.0: 20.2.5.1 Namespace Modifier Objects Encoding: DefScope */ AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...) { diff --git a/include/hw/acpi/acpi-build-utils.h b/include/hw/acpi/acpi-build-utils.h index 56165e6..19ebc2d 100644 --- a/include/hw/acpi/acpi-build-utils.h +++ b/include/hw/acpi/acpi-build-utils.h @@ -22,6 +22,7 @@ typedef struct AcpiAml { void aml_append(AcpiAml *parent_ctx, AcpiAml child); /* Block ASL object primitives */ +AcpiAml acpi_method(const char *name, int arg_count); AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...); AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...); -- 1.8.3.1