From patchwork Wed Feb 18 19:14:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 441063 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 0E715140111 for ; Thu, 19 Feb 2015 06:26:25 +1100 (AEDT) Received: from localhost ([::1]:52451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOAGM-0003Db-Uf for incoming@patchwork.ozlabs.org; Wed, 18 Feb 2015 14:26:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOA5f-00084U-PR for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOA5b-0004GG-U1 for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOA5b-0004G3-Na for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:15 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1IJF7gn023486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Feb 2015 14:15:08 -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-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1IJExeD000755; Wed, 18 Feb 2015 14:15:06 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 18 Feb 2015 19:14:17 +0000 Message-Id: <1424286895-21611-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1424286895-21611-1-git-send-email-imammedo@redhat.com> References: <1424286895-21611-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: drjones@redhat.com, mst@redhat.com, zhaoshenglong@huawei.com, marcel.a@redhat.com Subject: [Qemu-devel] [PATCH v4 04/42] acpi: add aml_device() 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/aml-build.c | 11 +++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index f891406..c955d66 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -355,3 +355,14 @@ Aml *aml_scope(const char *name_format, ...) va_end(ap); return var; } + +/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefDevice */ +Aml *aml_device(const char *name_format, ...) +{ + va_list ap; + Aml *var = aml_bundle(0x82 /* DeviceOp */, AML_EXT_PACKAGE); + va_start(ap, name_format); + build_append_namestringv(var->buf, name_format, ap); + va_end(ap); + return var; +} diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 05dd3fc..004fa05 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -61,6 +61,7 @@ void aml_append(Aml *parent_ctx, Aml *child); /* Block AML object primitives */ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); /* other helpers */ GArray *build_alloc_array(void);