From patchwork Thu May 14 09:19:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48485 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF81D2121F for ; Thu, 14 May 2015 09:22:53 +0000 (UTC) Received: by laat2 with SMTP id t2sf18106509laa.2 for ; Thu, 14 May 2015 02:22: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=BjL7tPPGrsz3fF3h/NHX8ou3FH+FSgEJeLjJ5wqPQbw=; b=C10M8erpTTmr4YIOtulqKY5w/bbN0wTq+tsSHHjNTUhVYO4xdL7/MHNt8xmQy6HawU os7XQmGfD+5Go3ntuCZoiiEMTOJjiy6RPvQA9DUc3EGCGcFpzIYqtskaj0Q1wRSyV8+G RokHQy5+YPItgm44uLSQX89oaGzUQ8Ltr9/ScqDgwZpAL1zfahPe/8YE3E4yflGiUDB4 J7JRBuDVO38tZi98uusj6qpCefDYBloGgg2DDl/wr13spyY+LDbM3VsQM0bCb7XrgFn8 LC0Sic7XizcKVTe6NTyB2aC3PyuQxzTVGzs6hSg5WryixQCh/KdvZwratopabaemWF2Z 9+MQ== X-Gm-Message-State: ALoCoQkYJYCOwzApSii0pMg1TogGh9QXvntdHJ31u9OmTJTFWaGq0/7N0XcOO2qXaoIIWHTwyz3W X-Received: by 10.112.171.41 with SMTP id ar9mr2407988lbc.24.1431595372787; Thu, 14 May 2015 02:22:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.101 with SMTP id p5ls431575laj.53.gmail; Thu, 14 May 2015 02:22:52 -0700 (PDT) X-Received: by 10.112.126.136 with SMTP id my8mr2430427lbb.18.1431595372677; Thu, 14 May 2015 02:22:52 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id ba11si14105928lab.113.2015.05.14.02.22.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 02:22:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by layy10 with SMTP id y10so58953254lay.0 for ; Thu, 14 May 2015 02:22:52 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr2474822lab.35.1431595372569; Thu, 14 May 2015 02:22:52 -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 hn6csp1113090lbb; Thu, 14 May 2015 02:22:51 -0700 (PDT) X-Received: by 10.55.24.211 with SMTP id 80mr6557637qky.59.1431595369575; Thu, 14 May 2015 02:22:49 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f132si15620093qhc.118.2015.05.14.02.22.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 14 May 2015 02:22: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]:53243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspLs-0001ZR-Jf for patch@linaro.org; Thu, 14 May 2015 05:22:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspKi-0000Aa-EK for qemu-devel@nongnu.org; Thu, 14 May 2015 05:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YspKd-0004zf-Gk for qemu-devel@nongnu.org; Thu, 14 May 2015 05:21:36 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:31069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspKc-0004tK-Cl for qemu-devel@nongnu.org; Thu, 14 May 2015 05:21:31 -0400 Received: from 172.24.2.119 (EHLO szxeml430-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CNT05326; Thu, 14 May 2015 17:21:16 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.158.1; Thu, 14 May 2015 17:21:04 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 14 May 2015 17:19:37 +0800 Message-ID: <1431595182-7552-19-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1431595182-7552-1-git-send-email-zhaoshenglong@huawei.com> References: <1431595182-7552-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: 58.251.152.64 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v7 18/23] 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.42 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 d62c2b3..de8593c 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -732,6 +732,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 1cf739c..37ec525 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -267,6 +267,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);