From patchwork Tue Feb 23 08:12:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 62675 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1703007lbl; Tue, 23 Feb 2016 00:16:12 -0800 (PST) X-Received: by 10.140.168.85 with SMTP id o82mr42299993qho.10.1456215372005; Tue, 23 Feb 2016 00:16:12 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b18si32944379qka.112.2016.02.23.00.16.11; Tue, 23 Feb 2016 00:16:11 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9498462D4C; Tue, 23 Feb 2016 08:16:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6624062EEC; Tue, 23 Feb 2016 08:14:00 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 84C77622D4; Tue, 23 Feb 2016 08:13:53 +0000 (UTC) Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by lists.linaro.org (Postfix) with ESMTPS id 3CEE9617F8 for ; Tue, 23 Feb 2016 08:13:24 +0000 (UTC) Received: by mail-pf0-f173.google.com with SMTP id e127so108431105pfe.3 for ; Tue, 23 Feb 2016 00:13:24 -0800 (PST) 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=Ffd8mYgXkOY5JD1rBfUpZmUF4pi9bO7IU44XdTmRmJs=; b=g7ZkmmzWitnORaM7ucSrWp4waS4t4Vco24+ed8Rq1dmg+vl6rQFREOgf6s3jDAY8ko NYXMzK7f4jrdPe5TUBN26MDXgVNYjYx5Fj/0TjVcBHo4QH9A75dhmgA+9TEW3AIslzMN zknnzRaQ8c3Wv5ZF1JXTSOgPwAh5TZmWXmk/PvlLSEOsa/NKCzCLKja84Oes/nsOlZXD RWbezhzyu3rkaog6xKtBp4r0anquqogAuy811GTqd48Et9CVkIv0cKINoDst2A6Nb2ZQ w7OUZO3a/X+msoK3qxLmns3dkx9UC3vhP/8JGwL9M7WITVGvwcRkFN0w/63RxdFzk54B wTJA== X-Gm-Message-State: AG10YOTZ7nkjfuzUt506rFY+xiQuZF/i43+HZU1S0te5lZaEMKQozJyWSTXCJCBopJb/2/XKuuo= X-Received: by 10.98.67.149 with SMTP id l21mr44492037pfi.112.1456215203663; Tue, 23 Feb 2016 00:13:23 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id 17sm41920352pfp.96.2016.02.23.00.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 00:13:23 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 23 Feb 2016 16:12:49 +0800 Message-Id: <1456215173-4456-5-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> References: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v4 4/8] linux-generic: create ARM files and move ARM ODP_CACHE_LINE_SIZE in it X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Hongbo Zhang Currently all ODP_CACHE_LINE_SIZE macros for different architectures are held in one header file, they should be moved to their own arch file. And in the legacy codes there was no ARM architecture directory, so this patch create it, the odp_cpu_arch.c and odp_sysinfo_parse.c are still symlink to the general default ones under arch/linux/, and a real file arm/odp/cpu_arch.h is created from the linux/odp/cpu_arch.h, and then the ODP_CACHE_LINE_SIZE for ARM is moved to this arch specific file. Signed-off-by: Hongbo Zhang Reviewed-and-tested-by: Bill Fischofer --- configure.ac | 1 + platform/linux-generic/Makefile.am | 2 ++ platform/linux-generic/arch/arm/odp/cpu_arch.h | 32 ++++++++++++++++++++++ platform/linux-generic/arch/arm/odp_cpu_arch.c | 1 + .../linux-generic/arch/arm/odp_sysinfo_parse.c | 1 + platform/linux-generic/include/odp/align.h | 6 ---- 6 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 platform/linux-generic/arch/arm/odp/cpu_arch.h create mode 120000 platform/linux-generic/arch/arm/odp_cpu_arch.c create mode 120000 platform/linux-generic/arch/arm/odp_sysinfo_parse.c diff --git a/configure.ac b/configure.ac index c8ee8f8..01b1a93 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,7 @@ AX_VALGRIND_CHECK ########################################################################## AS_CASE([$host], [x86*], [ARCH=x86], + [arm*], [ARCH=arm], [mips64*], [ARCH=mips64], [powerpc*], [ARCH=powerpc], [ARCH=linux] diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index a9090a3..42c1657 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -157,6 +157,8 @@ __LIB__libodp_la_SOURCES = \ EXTRA_DIST = \ arch/linux/odp_cpu_arch.c \ arch/linux/odp_sysinfo_parse.c \ + arch/arm/odp_cpu_arch.c \ + arch/arm/odp_sysinfo_parse.c \ arch/mips64/odp_cpu_arch.c \ arch/mips64/odp_sysinfo_parse.c \ arch/powerpc/odp_cpu_arch.c \ diff --git a/platform/linux-generic/arch/arm/odp/cpu_arch.h b/platform/linux-generic/arch/arm/odp/cpu_arch.h new file mode 100644 index 0000000..29f8889 --- /dev/null +++ b/platform/linux-generic/arch/arm/odp/cpu_arch.h @@ -0,0 +1,32 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PLAT_CPU_ARCH_H_ +#define ODP_PLAT_CPU_ARCH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odp_compiler_optim + * @{ + */ + +#define ODP_CACHE_LINE_SIZE 64 + +/** + * @} + */ + +static inline void odp_cpu_pause(void) +{ +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c new file mode 120000 index 0000000..c5fe400 --- /dev/null +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c @@ -0,0 +1 @@ +../linux/odp_cpu_arch.c \ No newline at end of file diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c new file mode 120000 index 0000000..2f368af --- /dev/null +++ b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c @@ -0,0 +1 @@ +../linux/odp_sysinfo_parse.c \ No newline at end of file diff --git a/platform/linux-generic/include/odp/align.h b/platform/linux-generic/include/odp/align.h index 46b30dc..d824d57 100644 --- a/platform/linux-generic/include/odp/align.h +++ b/platform/linux-generic/include/odp/align.h @@ -31,12 +31,6 @@ extern "C" { #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) -#if defined __arm__ || defined __aarch64__ - -#define ODP_CACHE_LINE_SIZE 64 - -#endif - #else #error Non-gcc compatible compiler #endif