From patchwork Thu Jan 22 14:49:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 431909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 17894140216 for ; Fri, 23 Jan 2015 02:49:50 +1100 (AEDT) Received: from localhost ([::1]:54458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEK0y-0007Jg-59 for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 10:49:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEK0h-0006Qo-Hr for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:49:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEK0e-0003eq-9n for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:49:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEK0e-0003ei-2Z for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:49:28 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0MFiJnb025964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Jan 2015 10:44:22 -0500 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0MEoYdY030524; Thu, 22 Jan 2015 09:50:49 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Thu, 22 Jan 2015 14:49:53 +0000 Message-Id: <1421938231-25698-10-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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 09/47] acpi: add acpi_int() term X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Igor Mammedov --- hw/acpi/acpi-build-utils.c | 11 +++++++++++ include/hw/acpi/acpi-build-utils.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/acpi/acpi-build-utils.c b/hw/acpi/acpi-build-utils.c index b68e1d8..745e58b 100644 --- a/hw/acpi/acpi-build-utils.c +++ b/hw/acpi/acpi-build-utils.c @@ -305,6 +305,17 @@ static AcpiAml aml_allocate_internal(uint8_t op, AcpiBlockFlags flags) } /* + * ACPI 5.0: 20.2.3 Data Objects Encoding: + * encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp + */ +AcpiAml acpi_int(const uint64_t val) +{ + AcpiAml var = aml_allocate_internal(0, NON_BLOCK); + build_append_int(var.buf, val); + return var; +} + +/* * help to construct NameString, which return AcpiAml object * for using with other aml_append or other acpi_* terms */ diff --git a/include/hw/acpi/acpi-build-utils.h b/include/hw/acpi/acpi-build-utils.h index d21e107..2ea53f9 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); /* non block ASL object primitives */ +AcpiAml acpi_int(const uint64_t val); AcpiAml GCC_FMT_ATTR(1, 2) acpi_name(const char *name_format, ...); AcpiAml acpi_name_decl(const char *name, AcpiAml val); /* Block ASL object primitives */