From patchwork Tue Nov 17 09:40:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7634891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE47F9F2EC for ; Tue, 17 Nov 2015 10:00:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C313B20494 for ; Tue, 17 Nov 2015 10:00:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D846B20499 for ; Tue, 17 Nov 2015 10:00:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyd25-0006by-0A; Tue, 17 Nov 2015 09:58:37 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZycrL-0002Oi-6U for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:47:33 +0000 Received: by wmec201 with SMTP id c201so218075502wme.0 for ; Tue, 17 Nov 2015 01:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qAWPkOZnsOcgf66EzIivoZiQP4cPFJNYnlPJ8+JnrNw=; b=O0jCpedlU6eIxgZJqS4xWYP6qiyBFGJh/uw/Sn4ph3eQolFo/XZgxXN1lt+l9xiR6q tLiCu1hOy5NwqufHPhxTFJ9WubTEkU9g9A2RHfQrSuSNgTvORJSQksuE0FjaV1nlPPri 34iymmz1N8YR7fSzhFR2z3MEE3sX5eIx2FkLsOt3RKl7BosY6MA44o0JJVy/Zz1L5tOL 1dQ5b+McnUsyZgqRiLWPVLv27plloHdW8Ywk11Rz91zHupUad/8jksjlA2n9asjImUxP sJWdNKKGHmB7aCBTlXzdblWWGOgm1McQNCVqsOqNUouG8vcSYuNdVyhT0iXJL9Ad9rO5 MRHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qAWPkOZnsOcgf66EzIivoZiQP4cPFJNYnlPJ8+JnrNw=; b=f9Nb4zHxLlDzlhBm4ifJtZ21bSEFIgVJrYWrNEz3zdMGIpMbYlRgWjyIx7CBdAcRY/ r5SQMcjOd21YcgNQyOt8+TIcWmy+zTc1Lnq/yACvrYdO6n/2v/CEgI8VbHlihB05RZN2 xbBIzgr1J1wlbFBIi3z+sw/9rN8py97R84SXOiQgrluKy0x3Wycys2R68sqfGwi9w6Wk f9c78R/tVy1kDqgqofyF/MHYtxu5H3z9nqt0bpvkfMC8RseoN8rMYB4/nSTVxCJWXQf5 UhnK70+Loxv5kDETwO6bl8a+GldS7kD9iuKTRS+19qPVa6e7VY9mv3iwCIGDrZdsapdb 3bdg== X-Gm-Message-State: ALoCoQmXe/GvlbVNOiqea4FhecLxxEdp/8hUxZsgPHqI9RmZZaaUz/dx0z/iaDaQL2SxPwO7EyPx X-Received: by 10.194.189.133 with SMTP id gi5mr42526528wjc.13.1447753629730; Tue, 17 Nov 2015 01:47:09 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id h7sm38995911wjz.7.2015.11.17.01.47.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:47:09 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Subject: [PATCH v3 41/62] arm/acpi: Add a helper function to get the acpi table offset Date: Tue, 17 Nov 2015 17:40:40 +0800 Message-Id: <1447753261-7552-42-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_014731_707114_16E0F098 X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao Signed-off-by: Shannon Zhao --- xen/arch/arm/acpi/lib.c | 13 +++++++++++++ xen/include/asm-arm/acpi.h | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c index 47f4c6a..d6044ef 100644 --- a/xen/arch/arm/acpi/lib.c +++ b/xen/arch/arm/acpi/lib.c @@ -70,3 +70,16 @@ unsigned int acpi_get_irq_type(u32 flags) return ACPI_IRQ_TYPE_NONE; } } + +unsigned int acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index) +{ + int i; + unsigned int offset = 0; + + for ( i = 0; i < index; i++ ) + { + offset += PAGE_ALIGN(tbl_add[i].size); + } + + return offset; +} diff --git a/xen/include/asm-arm/acpi.h b/xen/include/asm-arm/acpi.h index f159d51..628f3c8 100644 --- a/xen/include/asm-arm/acpi.h +++ b/xen/include/asm-arm/acpi.h @@ -24,6 +24,7 @@ #define _ASM_ARM_ACPI_H #include +#include #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long @@ -47,11 +48,16 @@ bool_t __init acpi_psci_present(void); bool_t __init acpi_psci_hvc_present(void); void __init acpi_smp_init_cpus(void); unsigned int acpi_get_irq_type(u32 flags); +unsigned int acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index); #else static inline bool_t acpi_psci_present(void) { return false; } static inline bool_t acpi_psci_hvc_present(void) {return false; } static inline void acpi_smp_init_cpus(void) { } static inline unsigned int acpi_get_irq_type(u32 flags) { return 0; } +unsigned int acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index) +{ + return 0; +} #endif /* CONFIG_ACPI */ /* Basic configuration for ACPI */