linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors
Date: Fri,  4 Feb 2011 14:20:43 +0000	[thread overview]
Message-ID: <1296829243-21313-1-git-send-email-dave.martin@linaro.org> (raw)

Pre-v7 processors don't have wfe/sev, so these are defined for
consistency as empty barrier asms.

For v6, wfi is architected as a defined MCR instruction, so
use that definition.

Doing a no-op instead of wfi() is probably bad, so for older
processors than v6, wfi() is not defined.  If needed, some CPU-
specific wfi() will have to be defined elsewhere.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
 arch/arm/include/asm/system.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 97f6d60..0e1cae3 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -129,7 +129,14 @@ extern unsigned int user_debug;
 #define sev()	__asm__ __volatile__ ("sev" : : : "memory")
 #define wfe()	__asm__ __volatile__ ("wfe" : : : "memory")
 #define wfi()	__asm__ __volatile__ ("wfi" : : : "memory")
+#else /* __LINUX_ARM_ARCH__ < 7 */
+#define sev()	__asm__ __volatile__ ("" : : : "memory")
+#define wfe()	__asm__ __volatile__ ("" : : : "memory")
+#if __LINUX_ARM_ARCH__ == 6
+#define wfi()	__asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
+					: : "r" (0) : "memory")
 #endif
+#endif /* __LINUX_ARM_ARCH__ < 7 */
 
 #if __LINUX_ARM_ARCH__ >= 7
 #define isb() __asm__ __volatile__ ("isb" : : : "memory")
-- 
1.7.1

             reply	other threads:[~2011-02-04 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04 14:20 Dave Martin [this message]
2011-02-08  8:40 ` [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors Santosh Shilimkar
2011-02-08  8:45 ` Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296829243-21313-1-git-send-email-dave.martin@linaro.org \
    --to=dave.martin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).