From patchwork Fri May 29 13:10:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49199 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 663F9218E7 for ; Fri, 29 May 2015 13:23:58 +0000 (UTC) Received: by lagv1 with SMTP id v1sf20615561lag.1 for ; Fri, 29 May 2015 06:23:57 -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 :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=oKpWmhaRaWC85Kpw9kSiu2b4ogxfro50/XJkMUH7xko=; b=Q5aYwOnKbZmeCy5DnUvCs+Uz6ZSJq6cpAHhvVtTH0m/W9C5KY3X53w4H57ulZESbLg ka4gmbViMbgsJc/LeREY5zc/a/GE4n4MFBEynaa4MhgtIczN/OpXinHp5Fcd8lQ10Ikp DpHqS7H6eXePnPSsowSkTQL4/8tLI2yCmDIJRqNZYK0ydMti573NJYEf4xyoKInSr+KO +1XxqqKdqlJ1p4XBh1do9cUOWHeEztvl65Yv2azCyTQV7fnZxf0HgaVgzTcLOXSH/P3c u7540q4+cj0cchPfhkZfwJDLjFL6Y1ny9cCpXRTodLhkmP7oYiuwwxCpXqZa2m7uWZf6 qRwg== X-Gm-Message-State: ALoCoQmGdrhmLKkjr7VfehR6osexuWCPtW4xipD4AZLY/IXc39TKVKZeSy6nyPqZuK4zMthjRzSm X-Received: by 10.152.2.169 with SMTP id 9mr7343645lav.1.1432905837235; Fri, 29 May 2015 06:23:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.231 with SMTP id i7ls316439lae.85.gmail; Fri, 29 May 2015 06:23:57 -0700 (PDT) X-Received: by 10.152.120.106 with SMTP id lb10mr7829941lab.92.1432905837090; Fri, 29 May 2015 06:23:57 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id vk4si4669390lbb.147.2015.05.29.06.23.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 06:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labpy14 with SMTP id py14so43928289lab.0 for ; Fri, 29 May 2015 06:23:57 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr8167854lbc.32.1432905836956; Fri, 29 May 2015 06:23:56 -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 hn6csp330326lbb; Fri, 29 May 2015 06:23:55 -0700 (PDT) X-Received: by 10.140.18.141 with SMTP id 13mr9443746qgf.96.1432905835372; Fri, 29 May 2015 06:23:55 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b102si5574533qga.35.2015.05.29.06.23.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 06:23:55 -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]:35866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyKGQ-0002I3-FA for patch@linaro.org; Fri, 29 May 2015 09:23:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3u-0003sp-SK for qemu-devel@nongnu.org; Fri, 29 May 2015 09:11:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyK3q-0003Wx-NL for qemu-devel@nongnu.org; Fri, 29 May 2015 09:10:58 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3q-0003US-Gi for qemu-devel@nongnu.org; Fri, 29 May 2015 09:10:54 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YyK3j-0005oB-1G for qemu-devel@nongnu.org; Fri, 29 May 2015 14:10:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 May 2015 14:10:39 +0100 Message-Id: <1432905045-22138-34-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> References: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 33/39] 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: peter.maydell@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.49 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 Reviewed-by: Michael S. Tsirkin Message-id: 1432522520-8068-20-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell --- 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);