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: 56740 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1827211lbb; Tue, 17 Nov 2015 01:48:20 -0800 (PST) X-Received: by 10.31.163.9 with SMTP id m9mr2609481vke.78.1447753700000; Tue, 17 Nov 2015 01:48:20 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id g103si2026880vki.56.2015.11.17.01.48.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Nov 2015 01:48:19 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zycr2-0006Zk-SI; Tue, 17 Nov 2015 09:47:12 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zycr1-0006Xq-27 for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:47:11 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id C7/A0-06091-E97FA465; Tue, 17 Nov 2015 09:47:10 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-9.tower-206.messagelabs.com!1447753629!4238413!1 X-Originating-IP: [74.125.82.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57969 invoked from network); 17 Nov 2015 09:47:10 -0000 Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:47:10 -0000 Received: by wmvv187 with SMTP id v187so217921874wmv.1 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=QD6Zo23njNU0Es2GiG6nQKZQQBZjHG1wHGoDlUXBvacRlrCIMChc0ZWKKGMP5SaoMQ T9nf4nadrwtj9IcrQA8fe8iZ2pju7KXCsFtxIOm03HlbFBtqI9+ahCh3lHIPzcJmElqg 6BFu8dYBCgWk9C8R77pgUHlbnkGMhCANDD3i22/4Ab8s9wOJ7Q43Id/JWIvuANP4INt4 a+0Ytypw6i2MoTPfsrcHt85ptu0aRnhSQwM+E4rdZW+n33RF4xREyy1P9N/j6AkXC8t0 gy2FL6TRcvclg/B8W3ULfwuEkt4Twc8q6ED71Cad2rQNrasMsUdCBEy0szlNjQ1LQDgv XhFA== X-Gm-Message-State: ALoCoQkW8AihrPUHUztAQpK3us7V0ePVKONNQUZklDiDIo4ds2vtB7KEeejBLJ0UH2qNyI9jwzp/ 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 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> 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 Subject: [Xen-devel] [PATCH v3 41/62] arm/acpi: Add a helper function to get the acpi table offset X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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(+) -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel 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 */