From patchwork Thu May 21 02:28:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48839 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B55992121F for ; Thu, 21 May 2015 02:41:52 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf22755421wgt.1 for ; Wed, 20 May 2015 19:41:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding: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=oUVdE1N+4O0EPa3MO/u9tFZxkOM20b1ku6NraF/gEFg=; b=BDdA4N6oO544uqwkTMGum9IeMOJjdxeT0OO0YINYFvvXTtayyEpt9zBd11pjt16Nwh HluJxyX5q5bwL5NTnrMPlxHVSxw2sB8J860kBGAOPKgn5+fiHMVMPlSyUmvRZTUvIrXG bj3ThUZ+26AhUwVKOrHJGupfVDX2fZEbt5DXgg/+s9qruotbtlBdyOsWIYnPpmFnSCWA SqsrBAnhzuKC6VVZoa9uuplsVUUJAUgOCxSpw1e98uLFcRsuyalA3ffut0iNqKt4H1Yk udVyX++O6GAl4t+gB/lc16a1ExboBFAgGVxc1uzLNQnG4/hAZVrEpOhJBuQfHmNWxCzK ZZ6w== X-Gm-Message-State: ALoCoQmVAD1vdncCOlOfPxBbZInh8K2oeGqdLX4wQdLlK8Qqxf01NADUsDby0hzbgCBZ2djR2ttK X-Received: by 10.194.240.164 with SMTP id wb4mr472838wjc.1.1432176111659; Wed, 20 May 2015 19:41:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.232 with SMTP id o8ls291368lag.39.gmail; Wed, 20 May 2015 19:41:51 -0700 (PDT) X-Received: by 10.112.172.35 with SMTP id az3mr290636lbc.99.1432176111519; Wed, 20 May 2015 19:41:51 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id xz5si8951909lbb.63.2015.05.20.19.41.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 19:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbcmx3 with SMTP id mx3so8055282lbc.1 for ; Wed, 20 May 2015 19:41:51 -0700 (PDT) X-Received: by 10.112.204.104 with SMTP id kx8mr336594lbc.72.1432176111389; Wed, 20 May 2015 19:41:51 -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.108.230 with SMTP id hn6csp232303lbb; Wed, 20 May 2015 19:41:50 -0700 (PDT) X-Received: by 10.140.235.144 with SMTP id g138mr553091qhc.73.1432176109432; Wed, 20 May 2015 19:41:49 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z105si14892827qgz.67.2015.05.20.19.41.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 19:41:49 -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]:54665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGQe-0003OS-GN for patch@linaro.org; Wed, 20 May 2015 22:41:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGPm-0002Yq-6l for qemu-devel@nongnu.org; Wed, 20 May 2015 22:40:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvGPg-0001uJ-PP for qemu-devel@nongnu.org; Wed, 20 May 2015 22:40:54 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:5660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGPg-0001te-1D for qemu-devel@nongnu.org; Wed, 20 May 2015 22:40:48 -0400 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLR49652; Thu, 21 May 2015 10:30:34 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Thu, 21 May 2015 10:30:24 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 21 May 2015 10:28:46 +0800 Message-ID: <1432175331-12548-20-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432175331-12548-1-git-send-email-zhaoshenglong@huawei.com> References: <1432175331-12548-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v8 19/24] hw/acpi/aml-build: Add aml_create_dword_field() 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+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: patch@linaro.org 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.182 as permitted sender) smtp.mail=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 From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Alex Bennée Reviewed-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 cfe1b29..2927be1 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -738,6 +738,17 @@ Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule) return var; } +/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */ +Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name) +{ + Aml *var = aml_alloc(); + build_append_byte(var->buf, 0x8A); /* CreateDWordFieldOp */ + 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, ...) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index c999ef1..ae62995 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -259,6 +259,7 @@ Aml *aml_package(uint8_t num_elements); 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_varpackage(uint32_t num_elements); Aml *aml_touuid(const char *uuid);