From patchwork Mon Apr 28 11:41:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 29224 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA92920553 for ; Mon, 28 Apr 2014 11:43:09 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf16376326qge.0 for ; Mon, 28 Apr 2014 04:43:09 -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=OmQHUkCPFXIuEnGe+RzklXRaiKHcMfy2g6Cpq9u/MGU=; b=dJKpGpZKYpw0WXoyoBYHWDufL4gne/1iSvXA43/O9K7EBMGirLiMbYIYC7kzlnZMh/ guNsbqEjRdYawdSowEzBJC7QAudkNf3Mqb071S5bzVYNKxR0vzfPPoy0xmM8gFbzzvx/ P+BnvEcDT2RYkHPAR20wz5X9R12ErZFgtUIVH/3x18GKG7h2NiqzT7zuuw5OKEdnvEMz fKPct0zGq8qwuubVdi/UHv0nPIGshUCVFckQN2w3l0v0bWIdrabMu8wuMGdkibRTmTpw tjJ/H8AL2wkI3lTT1sSTLHjN0MyyRxpHY1OLrS79q5aPxpRy7QuLzn1JY2kv1YNFODX7 mHUg== X-Gm-Message-State: ALoCoQnBCF7O1O/to7ztW9FjJQJNKKSvL66WatNYEkIDl0WpirdFheixcyInHtWpIMcV1mRynRl0 X-Received: by 10.236.127.35 with SMTP id c23mr9465481yhi.51.1398685389435; Mon, 28 Apr 2014 04:43:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.201 with SMTP id k67ls2623415qge.22.gmail; Mon, 28 Apr 2014 04:43:09 -0700 (PDT) X-Received: by 10.220.184.72 with SMTP id cj8mr7679430vcb.10.1398685389296; Mon, 28 Apr 2014 04:43:09 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id rn1si3549648vec.186.2014.04.28.04.43.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:43:09 -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.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so8055566veb.27 for ; Mon, 28 Apr 2014 04:43:09 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr20270175vdc.21.1398685389224; Mon, 28 Apr 2014 04:43:09 -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 ib8csp110864vcb; Mon, 28 Apr 2014 04:43:08 -0700 (PDT) X-Received: by 10.224.72.66 with SMTP id l2mr32085818qaj.74.1398685388716; Mon, 28 Apr 2014 04:43:08 -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 z93si2354461qgz.155.2014.04.28.04.43.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:43:08 -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 1WejxH-0002sN-Ms; Mon, 28 Apr 2014 11:42:39 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wejw8-0002n3-NR for lng-odp@lists.linaro.org; Mon, 28 Apr 2014 11:41:28 +0000 Received: by mail-la0-f53.google.com with SMTP id ec20so4966561lab.12 for ; Mon, 28 Apr 2014 04:41:50 -0700 (PDT) X-Received: by 10.112.100.231 with SMTP id fb7mr569200lbb.56.1398685310763; Mon, 28 Apr 2014 04:41:50 -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.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:41:49 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 28 Apr 2014 14:41:14 +0300 Message-Id: <1398685276-4610-16-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 15/17] Split out platform-specific part of odp_sync.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_sync.h | 28 ++------------- platform/linux-generic/include/plat/odp_sync.h | 43 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 26 deletions(-) create mode 100644 platform/linux-generic/include/plat/odp_sync.h diff --git a/include/odp_sync.h b/include/odp_sync.h index cf56faa..e085c3e 100644 --- a/include/odp_sync.h +++ b/include/odp_sync.h @@ -18,6 +18,7 @@ extern "C" { #endif +#include /** * Synchronise stores @@ -25,35 +26,10 @@ extern "C" { * Ensures that all CPU store operations that precede the odp_sync_stores() * call are globally visible before any store operation that follows it. */ -static inline void odp_sync_stores(void) -{ -#if defined __x86_64__ || defined __i386__ - - __asm__ __volatile__ ("sfence\n" : : : "memory"); - -#elif defined __arm__ - - __asm__ __volatile__ ("dmb st" : : : "memory"); - -#elif defined __OCTEON__ - - __asm__ __volatile__ ("syncws\n" : : : "memory"); - -#else - __sync_synchronize(); -#endif -} - +void odp_sync_stores(void); #ifdef __cplusplus } #endif #endif - - - - - - - diff --git a/platform/linux-generic/include/plat/odp_sync.h b/platform/linux-generic/include/plat/odp_sync.h new file mode 100644 index 0000000..b551f08 --- /dev/null +++ b/platform/linux-generic/include/plat/odp_sync.h @@ -0,0 +1,43 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP synchronisation + */ + +#ifndef ODP_SYNC_H_ +#error This file should be included only into corresponding top level header +#else + +/** + * Synchronise stores + * + * Ensures that all CPU store operations that precede the odp_sync_stores() + * call are globally visible before any store operation that follows it. + */ +static inline void odp_sync_stores(void) +{ +#if defined __x86_64__ || defined __i386__ + + __asm__ __volatile__ ("sfence\n" : : : "memory"); + +#elif defined __arm__ + + __asm__ __volatile__ ("dmb st" : : : "memory"); + +#elif defined __OCTEON__ + + __asm__ __volatile__ ("syncws\n" : : : "memory"); + +#else + __sync_synchronize(); +#endif +} + +#endif