From patchwork Mon Apr 28 11:41:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 29211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CEFD420553 for ; Mon, 28 Apr 2014 11:41:51 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id if17sf4034122vcb.10 for ; Mon, 28 Apr 2014 04:41:51 -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:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=AX/pH6I0tlylE7u/Arqea+zq4W04oazEf32oW7P805g=; b=NByOmWT9jImZZKV/ZpY43RmjfJz/W+3QWFusdAeYMcYN7pAM1V43vLYdUiszCW9NL/ DTeMcYiW3Wg9gfD8IS6Dubv/K+H0vHzHg60mg+zUR2fOzD4eLWUwqMFToCk/pUBDv8r5 aRFpG/ElQdVMN6IqQXdBf8XvAkmeiwwn03Ii3JyKii4U4kPbL34Gi5GfxkZ/mcEJLOs2 vougL0XmhzJVrmBMLx7gXzL9rFVViyFJaCethtTRLP71xztposEqlrmbDt58sArTyS/Z UbnawoYN5k65026taUDBU9tBvmQ2Pmakv0qCe60IPpRyeTCvTnmqGgdkLGN1DBz+wg/g ymlw== X-Gm-Message-State: ALoCoQlcBfqbbrD50f4NwMhOKZVX+CVPpdjU5ZM6XhyX3rgd+KgzKsVfUoEWop3QQkj5E7iywHAn X-Received: by 10.224.29.129 with SMTP id q1mr12445370qac.3.1398685311558; Mon, 28 Apr 2014 04:41:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.212 with SMTP id z78ls2636871qgz.93.gmail; Mon, 28 Apr 2014 04:41:51 -0700 (PDT) X-Received: by 10.58.55.170 with SMTP id t10mr1237666vep.29.1398685311323; Mon, 28 Apr 2014 04:41:51 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id wj8si3554368vcb.92.2014.04.28.04.41.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:41:51 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id id10so127921vcb.3 for ; Mon, 28 Apr 2014 04:41:51 -0700 (PDT) X-Received: by 10.221.37.1 with SMTP id tc1mr448666vcb.32.1398685311244; Mon, 28 Apr 2014 04:41:51 -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.220.221.72 with SMTP id ib8csp110784vcb; Mon, 28 Apr 2014 04:41:50 -0700 (PDT) X-Received: by 10.224.26.71 with SMTP id d7mr31667118qac.29.1398685310822; Mon, 28 Apr 2014 04:41:50 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id v10si7592118qat.208.2014.04.28.04.41.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:41:50 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wejw1-0002mn-Pd; Mon, 28 Apr 2014 11:41:21 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wejvm-0002lK-S1 for lng-odp@lists.linaro.org; Mon, 28 Apr 2014 11:41:07 +0000 Received: by mail-lb0-f174.google.com with SMTP id c11so2022764lbj.19 for ; Mon, 28 Apr 2014 04:41:28 -0700 (PDT) X-Received: by 10.112.186.98 with SMTP id fj2mr678815lbc.54.1398685288922; Mon, 28 Apr 2014 04:41:28 -0700 (PDT) Received: from uglx0153363.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id x10sm9873857lad.1.2014.04.28.04.41.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:41:28 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 28 Apr 2014 14:41:01 +0300 Message-Id: <1398685276-4610-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> References: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Cc: linaro-networking@linaro.org Subject: [lng-odp] [RFC PATCH 02/17] Split out platform-specific part of odp_align.h X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 --- include/odp_align.h | 39 +-------------- platform/linux-generic/include/plat/odp_align.h | 61 +++++++++++++++++++++++ 2 files changed, 63 insertions(+), 37 deletions(-) create mode 100644 platform/linux-generic/include/plat/odp_align.h diff --git a/include/odp_align.h b/include/odp_align.h index ce72f01..241b58a 100644 --- a/include/odp_align.h +++ b/include/odp_align.h @@ -14,6 +14,8 @@ #ifndef ODP_ALIGN_H_ #define ODP_ALIGN_H_ +#include + #ifdef __cplusplus extern "C" { #endif @@ -43,38 +45,10 @@ extern "C" { */ #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) -#if defined __x86_64__ || defined __i386__ - -/** Cache line size */ -#define ODP_CACHE_LINE_SIZE 64 - -#elif defined __arm__ - -/** Cache line size */ -#define ODP_CACHE_LINE_SIZE 64 - -#elif defined __OCTEON__ - -/** Cache line size */ -#define ODP_CACHE_LINE_SIZE 128 - -#elif defined __powerpc__ - -/** Cache line size */ -#define ODP_CACHE_LINE_SIZE 64 - -#else -#error GCC target not found -#endif - #else #error Non-gcc compatible compiler #endif -/** Page size */ -#define ODP_PAGE_SIZE 4096 - - /* * Round up */ @@ -155,7 +129,6 @@ extern "C" { #define ODP_ALIGNED_PAGE ODP_ALIGNED(ODP_PAGE_SIZE) - /* * Check align */ @@ -174,16 +147,8 @@ extern "C" { #define ODP_VAL_IS_POWER_2(x) ((((x)-1) & (x)) == 0) - #ifdef __cplusplus } #endif #endif - - - - - - - diff --git a/platform/linux-generic/include/plat/odp_align.h b/platform/linux-generic/include/plat/odp_align.h new file mode 100644 index 0000000..78f3b38 --- /dev/null +++ b/platform/linux-generic/include/plat/odp_align.h @@ -0,0 +1,61 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP alignments + */ + +#ifndef ODP_ALIGN_H_ +#error This file should be included only into corresponding top level header +#else + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __GNUC__ + +#if defined __x86_64__ || defined __i386__ + +/** Cache line size */ +#define ODP_CACHE_LINE_SIZE 64 + +#elif defined __arm__ + +/** Cache line size */ +#define ODP_CACHE_LINE_SIZE 64 + +#elif defined __OCTEON__ + +/** Cache line size */ +#define ODP_CACHE_LINE_SIZE 128 + +#elif defined __powerpc__ + +/** Cache line size */ +#define ODP_CACHE_LINE_SIZE 64 + +#else +#error GCC target not found +#endif + +#else +#error Non-gcc compatible compiler +#endif + +/** Page size */ +#define ODP_PAGE_SIZE 4096 + + +#ifdef __cplusplus +} +#endif + +#endif