From patchwork Tue Jun 17 17:55:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 32101 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 89FC020C81 for ; Tue, 17 Jun 2014 17:56:55 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ij19sf26091044vcb.2 for ; Tue, 17 Jun 2014 10:56:55 -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=YpX1BdaOh2RIZMazjHI02BmhX7xdf50jsHjbYwB26WU=; b=lV544bXhy8LMbO56iCHeKUM5Vo0kZ3VvRn2JPNWtfeGR1apFT4Zu7RobzbZ/PgHXxx te4z9xAy61mKWOmTFZ2tPx1EPwAA3kZvfDApjWXDsFkui2g3mYUeNtI3kZnlCNw7CyaN P3jDeQ0YyRG452e9f5IzLr7Qx9ZoPqRW11BVQlMf0SROeMUJPcqToLR08NRBTORlhpEq WLvQCHUCelTqnB9Nyj8gdwqem3tVrcdN0w4/LGOP3xfJ4bBsTjt0AyOKfSyD2vT+Iiix 8V3UJvvHq/hfHNx2EqGkYh3VvQw/A91WXTTht6buqfKgTKq3wbrgZMsoSYsNdc9KOlMT goLA== X-Gm-Message-State: ALoCoQmIFzSaTEs4RCmXsJjlkdFb6+gEnTd1RoHSvXYYzrtGlirUBRt6WuVnvVb3YzsAyJ9qv5eE X-Received: by 10.58.187.68 with SMTP id fq4mr669778vec.0.1403027815376; Tue, 17 Jun 2014 10:56:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.173 with SMTP id 42ls422382qgh.27.gmail; Tue, 17 Jun 2014 10:56:55 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr13546013vdc.8.1403027815234; Tue, 17 Jun 2014 10:56:55 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id br4si5767673vcb.106.2014.06.17.10.56.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so7957892veb.14 for ; Tue, 17 Jun 2014 10:56:55 -0700 (PDT) X-Received: by 10.52.159.226 with SMTP id xf2mr19597856vdb.14.1403027815164; Tue, 17 Jun 2014 10:56: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 vs6csp227609vcb; Tue, 17 Jun 2014 10:56:54 -0700 (PDT) X-Received: by 10.140.19.21 with SMTP id 21mr36833103qgg.76.1403027814720; Tue, 17 Jun 2014 10:56:54 -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 h50si8975702qgf.62.2014.06.17.10.56.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:56:54 -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 1WwxbC-0004xc-KH; Tue, 17 Jun 2014 17:55:10 +0000 Received: from mail-la0-f41.google.com ([209.85.215.41]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WwxaA-0004no-B6 for lng-odp@lists.linaro.org; Tue, 17 Jun 2014 17:54:06 +0000 Received: by mail-la0-f41.google.com with SMTP id hz20so4247844lab.28 for ; Tue, 17 Jun 2014 10:55:43 -0700 (PDT) X-Received: by 10.112.50.241 with SMTP id f17mr18475158lbo.7.1403027743305; Tue, 17 Jun 2014 10:55:43 -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.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 10:55:42 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 17 Jun 2014 20:55:18 +0300 Message-Id: <1403027720-9738-17-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 16/18] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 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_sync.h | 21 ++---------- platform/linux-generic/include/plat/odp_sync.h | 43 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 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 c106c75..e085c3e 100644 --- a/include/odp_sync.h +++ b/include/odp_sync.h @@ -18,6 +18,7 @@ extern "C" { #endif +#include /** * Synchronise stores @@ -25,25 +26,7 @@ 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 } 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