From patchwork Wed Nov 17 06:50:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peppe CAVALLARO X-Patchwork-Id: 331201 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAH6m0wP023529 for ; Wed, 17 Nov 2010 06:50:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755500Ab0KQGua (ORCPT ); Wed, 17 Nov 2010 01:50:30 -0500 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]:56093 "EHLO eu1sys200aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799Ab0KQGua (ORCPT ); Wed, 17 Nov 2010 01:50:30 -0500 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKTON7NP0pEizgfekP0rMxyvcS4pMz8hz0@postini.com; Wed, 17 Nov 2010 06:50:29 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5B5626A for ; Wed, 17 Nov 2010 06:50:26 +0000 (GMT) Received: from mail1.ctn.st.com (mail1.ctn.st.com [164.130.116.128]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EC3A61479 for ; Wed, 17 Nov 2010 06:50:25 +0000 (GMT) Received: from localhost ([164.130.129.16]) by mail1.ctn.st.com (MOS 3.8.7a) with ESMTP id DLS00384 (AUTH cavagiu); Wed, 17 Nov 2010 07:50:24 +0100 (CET) From: Giuseppe CAVALLARO To: linux-sh@vger.kernel.org Cc: Giuseppe Cavallaro , Stuart Menefy Subject: [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement prefetch(). Date: Wed, 17 Nov 2010 07:50:17 +0100 Message-Id: <1289976617-27704-1-git-send-email-peppe.cavallaro@st.com> X-Mailer: git-send-email 1.5.5.6 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 06:50:31 +0000 (UTC) diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h index 46d5179..e3c73cd 100644 --- a/arch/sh/include/asm/processor_32.h +++ b/arch/sh/include/asm/processor_32.h @@ -199,10 +199,13 @@ extern unsigned long get_wchan(struct task_struct *p); #define ARCH_HAS_PREFETCHW static inline void prefetch(void *x) { - __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory"); + __builtin_prefetch(x, 0, 3); } -#define prefetchw(x) prefetch(x) +static inline void prefetchw(void *x) +{ + __builtin_prefetch(x, 1, 3); +} #endif #endif /* __KERNEL__ */