From patchwork Fri Feb 5 08:56:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 61263 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp958748lbl; Fri, 5 Feb 2016 00:59:34 -0800 (PST) X-Received: by 10.50.159.7 with SMTP id wy7mr14344882igb.24.1454662774243; Fri, 05 Feb 2016 00:59:34 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n77si25980703ioe.157.2016.02.05.00.59.33; Fri, 05 Feb 2016 00:59:34 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AD01361835; Fri, 5 Feb 2016 08:59:33 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=D3ch75Rh; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 16A6C6204C; Fri, 5 Feb 2016 08:57:50 +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 3CEAB61945; Fri, 5 Feb 2016 08:57:39 +0000 (UTC) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by lists.linaro.org (Postfix) with ESMTPS id A626961945 for ; Fri, 5 Feb 2016 08:57:08 +0000 (UTC) Received: by mail-pf0-f179.google.com with SMTP id 65so65639518pfd.2 for ; Fri, 05 Feb 2016 00:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GsUgfYj9TRdcZftFjwfO/CDFIwyjtym1nLE8pQVlEEo=; b=D3ch75RhfOE4oJB3UN84RppyEGVFxgmAE3KykeJmQzbqT5SQjeygQvOOKEMFRzNsou 3kRVFINts8S37bVLRyzEHsO8fAk7IDxcQlNOIlGmbOFVELrp/u/XL0ieTMrf4cAjFR1P 6+I5VJ2y2I72HuLgv/fIFYNRHqr6cBdj1EXpc= 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=GsUgfYj9TRdcZftFjwfO/CDFIwyjtym1nLE8pQVlEEo=; b=GtY5mx9KBTapvKgudCOVIHceUnDUbJ2uCtcnNnLtMgeeoXO6LMFIn/J8997U8TamuF 7AKFQfQAgwao8hFAPwU4gfYpH9b4kndwJ48mibud8rg9uYHL0t5Psvi0PCzxM7a0ema2 +6AshMLlTc8rie8pOyyVboqdhvYLX2sxMjJoq8RMwuNXsjJ3o6WCeFM76t4jGxpR1/rG wx+3Jfp1Qzkl7qMBdZ9nmUvhK2HCSLGIZ0Y9aW4SyogTdoTko4LCYlTLXOMzHqtGQ7zr aN6O97QiDBOKUE0lo0iMr1zTOfkL4w+W67wkOxuFls1JeJwQD1SLMxQL7UwYCwfPyTox VpNw== X-Gm-Message-State: AG10YOTDmLkogO835LwDcYUvkUJAWp9ovpmNNWaRQh6Pa5mVonxyE9X7Yf0xvi3KZ9TsvX9TUEI= X-Received: by 10.98.65.11 with SMTP id o11mr18054480pfa.115.1454662628073; Fri, 05 Feb 2016 00:57:08 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id h89sm18321814pfj.52.2016.02.05.00.57.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 00:57:07 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Fri, 5 Feb 2016 16:56:47 +0800 Message-Id: <1454662607-28792-5-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454662607-28792-1-git-send-email-hongbo.zhang@linaro.org> References: <1454662607-28792-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 API-NEXT 4/4] 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 --- configure.ac | 1 + platform/linux-generic/Makefile.am | 2 ++ platform/linux-generic/arch/arm/odp/cpu_arch.h | 36 ++++++++++++++++++++++ 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, 41 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 add8308..eab1753 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 94f1408..c242d8c 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -169,6 +169,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..5539185 --- /dev/null +++ b/platform/linux-generic/arch/arm/odp/cpu_arch.h @@ -0,0 +1,36 @@ +/* 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 + * @{ + */ + +/** + * @def ODP_CACHE_LINE_SIZE + * Cache line size + */ +#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