All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: Define wfi() macro for v6 processors
@ 2011-02-08 11:01 ` Dave Martin
  0 siblings, 0 replies; 54+ messages in thread
From: Dave Martin @ 2011-02-08 11:01 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Dave Martin, Tony Lindgren, Santosh Shilimkar, Jean Pihet,
	linux-omap, Nicolas Pitre, Russell King

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>
---
--------------------------------------------------------------------
v2 notes:

The first version of this patch incorrectly specified the write
buffer drain MCR (c7, c5, 4) instead of WFI (c7, c0, 5).  Now fixed.
I hang my head in shame!

The first version of this patch attempted to define wfe() and sev()
to empty asms also for pre-v6K processors.  Having thought about
this some more, I think that it may be better to wait until this
is actually needed before attempting to define these to anything.
Having no definition (giving a build error) seems safer than
having a wrong definition.

 arch/arm/include/asm/system.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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


^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2011-02-09 10:07 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 11:01 [PATCH v2] ARM: Define wfi() macro for v6 processors Dave Martin
2011-02-08 11:01 ` Dave Martin
2011-02-08 11:08 ` Russell King - ARM Linux
2011-02-08 11:08   ` Russell King - ARM Linux
2011-02-08 11:16   ` Dave Martin
2011-02-08 11:16     ` Dave Martin
2011-02-08 12:11   ` Arnd Bergmann
2011-02-08 12:11     ` Arnd Bergmann
2011-02-08 12:13     ` Russell King - ARM Linux
2011-02-08 12:13       ` Russell King - ARM Linux
2011-02-08 12:53       ` Arnd Bergmann
2011-02-08 12:53         ` Arnd Bergmann
2011-02-08 14:45         ` Dave Martin
2011-02-08 14:45           ` Dave Martin
2011-02-08 14:54           ` Santosh Shilimkar
2011-02-08 14:54             ` Santosh Shilimkar
2011-02-08 15:09             ` Dave Martin
2011-02-08 15:09               ` Dave Martin
2011-02-08 15:17               ` Arnd Bergmann
2011-02-08 15:17                 ` Arnd Bergmann
2011-02-08 16:32                 ` Russell King - ARM Linux
2011-02-08 16:32                   ` Russell King - ARM Linux
2011-02-08 16:58                   ` Arnd Bergmann
2011-02-08 16:58                     ` Arnd Bergmann
2011-02-08 17:15                     ` Dave Martin
2011-02-08 17:15                       ` Dave Martin
2011-02-08 15:15           ` Arnd Bergmann
2011-02-08 15:15             ` Arnd Bergmann
2011-02-08 15:30             ` Dave Martin
2011-02-08 15:30               ` Dave Martin
2011-02-08 15:42               ` Arnd Bergmann
2011-02-08 15:42                 ` Arnd Bergmann
2011-02-08 16:21                 ` Dave Martin
2011-02-08 16:21                   ` Dave Martin
2011-02-09 10:07                   ` Arnd Bergmann
2011-02-09 10:07                     ` Arnd Bergmann
2011-02-08 16:25             ` Russell King - ARM Linux
2011-02-08 16:25               ` Russell King - ARM Linux
2011-02-08 16:31               ` Dave Martin
2011-02-08 16:31                 ` Dave Martin
2011-02-08 16:47               ` Arnd Bergmann
2011-02-08 16:47                 ` Arnd Bergmann
2011-02-08 16:55                 ` Russell King - ARM Linux
2011-02-08 16:55                   ` Russell King - ARM Linux
2011-02-08 17:00                   ` Dave Martin
2011-02-08 17:00                     ` Dave Martin
2011-02-08 16:20           ` Russell King - ARM Linux
2011-02-08 16:20             ` Russell King - ARM Linux
2011-02-08 16:28             ` Dave Martin
2011-02-08 16:28               ` Dave Martin
2011-02-08 12:22     ` Dave Martin
2011-02-08 12:22       ` Dave Martin
2011-02-08 12:31       ` Santosh Shilimkar
2011-02-08 12:31         ` Santosh Shilimkar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.