From patchwork Tue Jun 17 17:55:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 32088 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0F0B2100C for ; Tue, 17 Jun 2014 17:55:56 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id uo5sf16521561pbc.8 for ; Tue, 17 Jun 2014 10:55:56 -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: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=rXuBvqnMw1X/zbyh901/o2u+gcP7p6aIsd1kXHv19Y4=; b=OK2aWlya7qQ+6drBsw8G7W+pwpXanaWWvC82bjugqolDpHGQtu4FtKNxIpeyTfWVUN YMZQWBfWoN6DHR4YG3qGZvOJy0TjT48yz2zvOL2AMlhWLLD5ehfWP+t6PCr7ZQheI+HA CR9/tmlkLtzZXEbqwO1RgCIq7Vg4chEqzb+57fGfZOgm33zZA5IHvCgNqmUApCylCps3 8hSllNSx8GvlFtiI0o84zR9rOeHymI8aKvv0ekAVwA0Gudq8MCYlfR0LTwyQqYxCXnxz Hvd4wON+/GKJVoWaemQaq2ygpZPXONfQKj7bL4TE7WgiJR5dL1XKcNu8b5Mm7fAi8Ek5 86AQ== X-Gm-Message-State: ALoCoQnYf4N23h87v6n8bLjVVCFJ2iV3zoP1ExCY5nikWFJTQMBaundFyYsJuzuByqPMkiHxs6AT X-Received: by 10.66.144.228 with SMTP id sp4mr1384657pab.5.1403027756127; Tue, 17 Jun 2014 10:55:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.247 with SMTP id l110ls4738373qgf.90.gmail; Tue, 17 Jun 2014 10:55:56 -0700 (PDT) X-Received: by 10.221.36.73 with SMTP id sz9mr1616749vcb.62.1403027755967; Tue, 17 Jun 2014 10:55:55 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id uw7si5775384vec.24.2014.06.17.10.55.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so6684488vcb.41 for ; Tue, 17 Jun 2014 10:55:55 -0700 (PDT) X-Received: by 10.52.52.168 with SMTP id u8mr19245870vdo.25.1403027755896; Tue, 17 Jun 2014 10:55:55 -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.221.54.6 with SMTP id vs6csp227548vcb; Tue, 17 Jun 2014 10:55:55 -0700 (PDT) X-Received: by 10.140.94.103 with SMTP id f94mr18052507qge.64.1403027755485; Tue, 17 Jun 2014 10:55:55 -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 g4si17873025qai.6.2014.06.17.10.55.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:55:55 -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 1WwxaF-0004p9-62; Tue, 17 Jun 2014 17:54:11 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WwxZy-0004mo-1q for lng-odp@lists.linaro.org; Tue, 17 Jun 2014 17:53:54 +0000 Received: by mail-la0-f51.google.com with SMTP id mc6so3916694lab.10 for ; Tue, 17 Jun 2014 10:55:31 -0700 (PDT) X-Received: by 10.152.27.134 with SMTP id t6mr11819352lag.41.1403027730935; Tue, 17 Jun 2014 10:55:30 -0700 (PDT) Received: from localhost.localdomain (176-241-155-136-dynamic.retail.datagroup.ua. [176.241.155.136]) by mx.google.com with ESMTPSA id d3sm11646351lbw.2.2014.06.17.10.55.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:55:30 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 17 Jun 2014 20:55:05 +0300 Message-Id: <1403027720-9738-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403027720-9738-1-git-send-email-taras.kondratiuk@linaro.org> References: <1403027720-9738-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 03/18] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) 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 Signed-off-by: Taras Kondratiuk --- include/odp_align.h | 32 +----------- platform/linux-generic/include/plat/odp_align.h | 61 +++++++++++++++++++++++ 2 files changed, 63 insertions(+), 30 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 83495a8..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,7 +147,6 @@ extern "C" { #define ODP_VAL_IS_POWER_2(x) ((((x)-1) & (x)) == 0) - #ifdef __cplusplus } #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