From patchwork Mon May 25 02:55:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48940 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E4C4B2121F for ; Mon, 25 May 2015 03:06:47 +0000 (UTC) Received: by wgez8 with SMTP id z8sf5669546wge.2 for ; Sun, 24 May 2015 20:06:47 -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=No0NWdTy9ibphrvh+gIxcmVs9vNHnO/VCI/bZSu7VVk80x/hjvt1Jetmb6hiGyREpS MCJiNpbhhVCwmm51rmZ2LAj68B8VDtQZiTL7vBdR+NinZtG/EVhX0TSuRgVjXmdXH7U3 TZM390B08PRgXW9SHf3EMjnWjULPjUYSWIcV0UMbkknm+MUi3pyiqXp6aOrv8QpJFzT0 Yid2aR2Qjc/Oqjsaf32ksG1orEFhAkbGfmbe654Pgmjlccv6suuNwtAX8K26n8CuoRHU YrkhvjvzS7iqjcQIYBAM2UykfkyT8sz9uwe1vOTa4GSM2+IQMEnlfUKSkD+dSO29815T +gYg== X-Gm-Message-State: ALoCoQnNBCDP7EUbx/95OqQ8gZwJSWOr34KYC/xz87ZD1RKhQDNtX8ZteUVd1m11lQlNywYFhJtz X-Received: by 10.112.122.39 with SMTP id lp7mr20218898lbb.5.1432523207250; Sun, 24 May 2015 20:06:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.206 with SMTP id q14ls102789lal.58.gmail; Sun, 24 May 2015 20:06:47 -0700 (PDT) X-Received: by 10.152.26.38 with SMTP id i6mr6425476lag.118.1432523207137; Sun, 24 May 2015 20:06:47 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id a15si7305199lbq.57.2015.05.24.20.06.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 20:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbzk7 with SMTP id zk7so43974414lbb.0 for ; Sun, 24 May 2015 20:06:46 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr16210195lbb.76.1432523206722; Sun, 24 May 2015 20:06:46 -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 hn6csp1543746lbb; Sun, 24 May 2015 20:06:45 -0700 (PDT) X-Received: by 10.140.109.199 with SMTP id l65mr24455691qgf.91.1432523205256; Sun, 24 May 2015 20:06:45 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u82si10139751qhd.11.2015.05.24.20.06.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 24 May 2015 20:06:45 -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]:41708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywiiy-0004kd-0r for patch@linaro.org; Sun, 24 May 2015 23:06:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwiZj-0004IE-Eb for qemu-devel@nongnu.org; Sun, 24 May 2015 22:57:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwiZf-00017r-NL for qemu-devel@nongnu.org; Sun, 24 May 2015 22:57:11 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:62237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwiZf-00016q-75 for qemu-devel@nongnu.org; Sun, 24 May 2015 22:57:07 -0400 Received: from 172.24.2.119 (EHLO szxeml428-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLV56171; Mon, 25 May 2015 10:56:42 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.158.1; Mon, 25 May 2015 10:56:31 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Mon, 25 May 2015 10:55:15 +0800 Message-ID: <1432522520-8068-20-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432522520-8068-1-git-send-email-zhaoshenglong@huawei.com> References: <1432522520-8068-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 v9 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.176 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);