From patchwork Wed Apr 15 13:25:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47192 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B8962121F for ; Wed, 15 Apr 2015 13:38:17 +0000 (UTC) Received: by lbdc7 with SMTP id c7sf9604115lbd.2 for ; Wed, 15 Apr 2015 06:38:16 -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=ZYXxZfEUiqwlvrqgeliQET0yl0Y7Kj3CN91TIM2Zl6Q=; b=Uz/DchwoDQzKCgaOQyPtGnmcNlbPyXZbvhBZCpvcKdp17EaApEnUJJftbUP7cCulz2 8LmjAUnLx0KkTPW9IldB7Xha0T8qR/Q7QstqjaGJ0RA96uX8FE0wtqTmd1rJ/bfB8jMC XwsKpepQyedgBwveAxBJ/W18BsXCGgsUzIicWgo1xbab+xdmlyS+laIbwq3WLQ4LsUEA FKRzr0dhp97D9TNkffKmkuoGFaBj4HrNrqaZHiHpGw0DwQIaGZjEziI7DvqkYht/AhSp ESCDug+8M9/Upac0fVij6EzQ293p6X6rSavXTQ7CzXsFR1pJjxGmwZJ1ileOdsCOI4XJ 2fYw== X-Gm-Message-State: ALoCoQmGkBHP59hC2GD0uK2tDAS8j7uWccW4OiRpTh/bYVVMduwB8jtvn672852Xm30Sb/PxcMrI X-Received: by 10.180.107.33 with SMTP id gz1mr4819053wib.3.1429105096407; Wed, 15 Apr 2015 06:38:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.167 with SMTP id dd7ls162128lad.28.gmail; Wed, 15 Apr 2015 06:38:16 -0700 (PDT) X-Received: by 10.112.16.97 with SMTP id f1mr7278567lbd.26.1429105096283; Wed, 15 Apr 2015 06:38:16 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id y11si3919321lbm.131.2015.04.15.06.38.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 06:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labbd9 with SMTP id bd9so32917231lab.2 for ; Wed, 15 Apr 2015 06:38:16 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr23586062lbd.29.1429105096167; Wed, 15 Apr 2015 06:38:16 -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.67.65 with SMTP id l1csp2519070lbt; Wed, 15 Apr 2015 06:38:15 -0700 (PDT) X-Received: by 10.55.20.215 with SMTP id 84mr51854339qku.51.1429105094906; Wed, 15 Apr 2015 06:38:14 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id p78si4641004qkp.60.2015.04.15.06.38.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Apr 2015 06:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:60580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNWA-0006sA-1Y for patch@linaro.org; Wed, 15 Apr 2015 09:38:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNQf-00073H-DY for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YiNQa-0006VT-UN for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:32:33 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:60871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNQa-0006VC-D6 for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:32:28 -0400 Received: from 172.24.2.119 (EHLO szxeml427-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CJV19392; Wed, 15 Apr 2015 21:26:47 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.158.1; Wed, 15 Apr 2015 21:26:36 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Wed, 15 Apr 2015 21:25:06 +0800 Message-ID: <1429104309-3844-18-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1429104309-3844-1-git-send-email-zhaoshenglong@huawei.com> References: <1429104309-3844-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, shannon.zhao@linaro.org, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v5 17/20] 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.215.46 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 --- 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 179acda..eb5b44f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -726,6 +726,17 @@ Aml *aml_field(const char *name, AmlFieldFlags flags) 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 c322d17..72c2396 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -261,6 +261,7 @@ Aml *aml_package(uint8_t num_elements); Aml *aml_buffer(void); Aml *aml_resource_template(void); Aml *aml_field(const char *name, AmlFieldFlags flags); +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); void build_append_int_noprefix(GArray *table, uint64_t value, int size);