From patchwork Sun Sep 13 12:43:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 53533 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 4B32D22B26 for ; Sun, 13 Sep 2015 12:49:32 +0000 (UTC) Received: by lbbmp1 with SMTP id mp1sf37536377lbb.2 for ; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=wE2PYpEAbqX36MQkLqq6oaP6BihHDCh5W0epL7x5ANE=; b=fhg/SN4e3Nwhti+ntQ8Dl1IDv4EsjvVvHLClE24B9ljVT8gdfPkynMlpzmN2mq9Y1c XPbDZvlf/N7aeiPwmCS54JGMDmtIjyzgc8xPKJeR8XqHFstoUlJ1Ct20W6S7gTkwRaTe tAnR4VuRRD7y2cpHMwSIKCGiSXtzmOKD1jP7/c42jc2ikaLLiD13+KPJHTucBiDp1xva P+rUXJ0GrhuNBkPSdWxM1qhI7mFQOnDwWU/1deL1io/mc4VU73tjWcdXoZHc+tfWJS2B +ZiZTAYRoCX3ku5HfTHPmEHf4B6mYWsBGK52s4cSJxF5/hQ+NMTmw5bmspQyRqksvup5 VRyg== X-Gm-Message-State: ALoCoQl7+my83HtEctJsUOdcnq8IGQKqhbehEGzC0o4ipUaQztoRpuG3N5pNTpGIr/uoT13UFuLM X-Received: by 10.180.81.165 with SMTP id b5mr1832442wiy.1.1442148570726; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.130 with SMTP id e2ls545860lam.40.gmail; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) X-Received: by 10.112.144.69 with SMTP id sk5mr8463013lbb.6.1442148570532; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id rc10si6422150lbb.160.2015.09.13.05.49.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 05:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbpo4 with SMTP id o4so56291465lbp.2 for ; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) X-Received: by 10.152.23.199 with SMTP id o7mr7838790laf.76.1442148570446; Sun, 13 Sep 2015 05:49:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp702381lbq; Sun, 13 Sep 2015 05:49:29 -0700 (PDT) X-Received: by 10.107.166.139 with SMTP id p133mr17129846ioe.113.1442148569549; Sun, 13 Sep 2015 05:49:29 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n6si4907185ige.76.2015.09.13.05.49.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Sep 2015 05:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6im-0003w7-Bm for patch@linaro.org; Sun, 13 Sep 2015 08:49:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6du-0004FH-Bj for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zb6dt-0000Rs-J8 for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6dt-0000RM-EK for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:25 -0400 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 (Postfix) with ESMTPS id 290EA8A171 for ; Sun, 13 Sep 2015 12:44:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8DChnP4024712; Sun, 13 Sep 2015 08:44:22 -0400 From: Laszlo Ersek To: qemu-devel@nongnu.org Date: Sun, 13 Sep 2015 14:43:46 +0200 Message-Id: <1442148227-17343-13-git-send-email-lersek@redhat.com> In-Reply-To: <1442148227-17343-1-git-send-email-lersek@redhat.com> References: <55F5647C.6030901@redhat.com> <1442148227-17343-1-git-send-email-lersek@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: Gal Hammer , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Subject: [Qemu-devel] [PATCH FYI 12/13] hw/acpi: add AML generator function for CreateQWordField() 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 It follows the pattern of CreateDWordField() / aml_create_dword_field(). Cc: Paolo Bonzini Cc: Gal Hammer Cc: Igor Mammedov Cc: "Michael S. Tsirkin" Signed-off-by: Laszlo Ersek --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 32e49b3..4f6a2be 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -280,6 +280,7 @@ Aml *aml_buffer(int buffer_size, uint8_t *byte_list); Aml *aml_resource_template(void); Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule); 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); Aml *aml_touuid(const char *uuid); Aml *aml_unicode(const char *str); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 5aeb289..ca5bcd7 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -854,6 +854,17 @@ Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name) return var; } +/* ACPI 2.0: 17.2.4.2 Named Objects Encoding: DefCreateQWordField */ +Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name) +{ + Aml *var = aml_alloc(); + build_append_byte(var->buf, 0x8F); /* DefCreateQWordField */ + aml_append(var, srcbuf); + aml_append(var, index); + build_append_namestring(var->buf, "%s", name); + return var; +} + /* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */ Aml *aml_string(const char *name_format, ...) {