From patchwork Thu May 7 09:29:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48094 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1986C20553 for ; Thu, 7 May 2015 09:37:24 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf10646074lbb.3 for ; Thu, 07 May 2015 02:37:23 -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=2yeyQkHX7eZoD1NeV8rbJXXVHnt6EdG8DaN1XjoA5nc=; b=UCv5Jiq2nMosB1+YiIt7m1fmJ82dcGymmvJkw4i0gkCJFqa5aOyOMOVU1KL9rGAml4 9w9fVOQaocsogNSmCPKOnPvurEFgNXFysFfewz7YH4YZpYAQz5aCTxxgVEPjUMS7uoh4 UOSaeilzMi2KY4CSQJhQr+EwJuwqFfQx4W6rZAFkx4xhO2TguOlHFKl/ytgKkZwoF3Sj NbzNuoww7PQYof7lYN2PCyjRZKE+T5t5untcZpHC8B5f9jsk+0zgEP5njmu5poeZ741u TJNkNdTTWowXO/KbvgtEQIKIq4St/USQ8uXQeG9bBSXptujyL2o2kIY0HEZIkCyGBBBm EgBA== X-Gm-Message-State: ALoCoQnoA9ZDmS8XHptQ/Y2pNROvIhvFykgcT8cWPkkzNPMb7ds1WcvuwxxreOm4q1ed7XOZOGyZ X-Received: by 10.112.51.68 with SMTP id i4mr1730830lbo.13.1430991443099; Thu, 07 May 2015 02:37:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.43 with SMTP id ll11ls183366lac.12.gmail; Thu, 07 May 2015 02:37:23 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr2264668lag.67.1430991442988; Thu, 07 May 2015 02:37:22 -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 y1si936243lae.68.2015.05.07.02.37.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 02:37:22 -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 layy10 with SMTP id y10so26406180lay.0 for ; Thu, 07 May 2015 02:37:22 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr2355636lbc.86.1430991442868; Thu, 07 May 2015 02:37:22 -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 l1csp3330396lbt; Thu, 7 May 2015 02:37:22 -0700 (PDT) X-Received: by 10.55.25.34 with SMTP id k34mr6368062qkh.12.1430991441556; Thu, 07 May 2015 02:37:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k39si1445794qgd.40.2015.05.07.02.37.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 May 2015 02:37:21 -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]:49695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIF6-0006YK-Ls for patch@linaro.org; Thu, 07 May 2015 05:37:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIAK-0007sR-GM for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqIAI-0001va-HM for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:24 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:42324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIAH-0001uM-Pr for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:22 -0400 Received: from 172.24.2.119 (EHLO szxeml426-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CNI17474; Thu, 07 May 2015 17:32:06 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.158.1; Thu, 7 May 2015 17:31:38 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 7 May 2015 17:29:20 +0800 Message-ID: <1430990964-10528-19-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1430990964-10528-1-git-send-email-zhaoshenglong@huawei.com> References: <1430990964-10528-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 v6 18/22] 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 f5d74a4..2e13510 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -737,6 +737,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 4fc0e5b..9fc4057 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(int buffer_size, uint8_t *byte_list); 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);