From patchwork Fri Jan 27 03:31:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 92555 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp53777qgi; Thu, 26 Jan 2017 19:32:12 -0800 (PST) X-Received: by 10.55.138.196 with SMTP id m187mr6211250qkd.214.1485487932688; Thu, 26 Jan 2017 19:32:12 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x67si2620659qka.111.2017.01.26.19.32.11; Thu, 26 Jan 2017 19:32:12 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A85AC62DFE; Fri, 27 Jan 2017 03:32:11 +0000 (UTC) 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 D051D609C2; Fri, 27 Jan 2017 03:32:07 +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 82F8A60A21; Fri, 27 Jan 2017 03:32:05 +0000 (UTC) Received: from mail-ot0-f180.google.com (mail-ot0-f180.google.com [74.125.82.180]) by lists.linaro.org (Postfix) with ESMTPS id 7288C609B0 for ; Fri, 27 Jan 2017 03:32:03 +0000 (UTC) Received: by mail-ot0-f180.google.com with SMTP id 65so189608057otq.2 for ; Thu, 26 Jan 2017 19:32:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JauJV2Vvod1Hdj5tEmgvuzrH3MYKV0sjgQvN3SFURYc=; b=o9nmjIXRnjscTCB9qA+nnbIyJk2otnFkcK7aNxyeNK7FfM5mdN9ae5brJMHVlpHDf3 KWd0jU/thFYTa9gqnXZvwfHZ/D58/E+NffZsuiM8rnp7WVhrfST9N4HVyK51q0UmUIa4 thy6TRQtgVtnbPrisADhd8kLkeETUlACuHm7Ais4eYZhvBRHrwHJP2hLAeyBt+9sRcB2 pdqdhjdIE3gp9HgMJSvAtfOat1fjum+jMgJCGC1zwg3ofnp4N25Glc67LXqqD+yFbDio EeCAJxoI/gY2YH6DS0V2Duk60m/75TQGuKHXHyYQcBP4l7T+zukgbNOVkNotA1LHIzGC hHjw== X-Gm-Message-State: AIkVDXI2iF79pxNtyyBUHTmAv54qu0GQAYUxDd5ync/m91gX38mbzGsRhxTPdJLxMJeKIxPsCJU= X-Received: by 10.157.61.244 with SMTP id l107mr2778883otc.122.1485487922892; Thu, 26 Jan 2017 19:32:02 -0800 (PST) Received: from localhost.localdomain (68-248-140-212.lightspeed.austtx.sbcglobal.net. [68.248.140.212]) by smtp.gmail.com with ESMTPSA id d10sm1803099otb.4.2017.01.26.19.32.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2017 19:32:02 -0800 (PST) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Thu, 26 Jan 2017 21:31:43 -0600 Message-Id: <20170127033143.43107-1-brian.brooks@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [PATCH] linux-generic: Add ARM odp_cpu_pause() 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Brian Brooks --- platform/linux-generic/arch/arm/odp/api/cpu_arch.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.11.0 Reviewed-by: Bill Fischofer diff --git a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h b/platform/linux-generic/arch/arm/odp/api/cpu_arch.h index 22b1da2d..7c75a690 100644 --- a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/arm/odp/api/cpu_arch.h @@ -15,6 +15,12 @@ extern "C" { static inline void odp_cpu_pause(void) { + /* YIELD hints the CPU to switch to another thread if possible + * and executes as a NOP otherwise. + * ISB flushes the pipeline, then restarts. This is guaranteed to + * stall the CPU a number of cycles. + */ + __asm volatile("isb" ::: "memory"); } #ifdef __cplusplus