linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors
@ 2011-02-04 14:20 Dave Martin
  2011-02-08  8:40 ` Santosh Shilimkar
  2011-02-08  8:45 ` Santosh Shilimkar
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Martin @ 2011-02-04 14:20 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors
  2011-02-04 14:20 [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors Dave Martin
@ 2011-02-08  8:40 ` Santosh Shilimkar
  2011-02-08  8:45 ` Santosh Shilimkar
  1 sibling, 0 replies; 3+ messages in thread
From: Santosh Shilimkar @ 2011-02-08  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

Dave,
> -----Original Message-----
> From: Dave Martin [mailto:dave.martin at linaro.org]
> Sent: Friday, February 04, 2011 7:51 PM
> To: linux-arm-kernel at lists.infradead.org
> Cc: Dave Martin; Tony Lindgren; Santosh Shilimkar; Jean Pihet;
> linux-omap at vger.kernel.org; Nicolas Pitre; Russell King
> Subject: [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7
> processors
>
> 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")
This is not true for "CPU_32v6K" extensions, right. I think they do
support 'sev' and 'wfe' instructions.


> +#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

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

* [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors
  2011-02-04 14:20 [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors Dave Martin
  2011-02-08  8:40 ` Santosh Shilimkar
@ 2011-02-08  8:45 ` Santosh Shilimkar
  1 sibling, 0 replies; 3+ messages in thread
From: Santosh Shilimkar @ 2011-02-08  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Santosh Shilimkar [mailto:santosh.shilimkar at ti.com]
> Sent: Tuesday, February 08, 2011 2:11 PM
> To: 'Dave Martin'; 'linux-arm-kernel at lists.infradead.org'
> Cc: 'Tony Lindgren'; Jean Pihet-XID; 'linux-omap at vger.kernel.org';
> 'Nicolas Pitre'; 'Russell King'
> Subject: RE: [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-
> v7 processors
>
> Dave,
> > -----Original Message-----
> > From: Dave Martin [mailto:dave.martin at linaro.org]
> > Sent: Friday, February 04, 2011 7:51 PM
> > To: linux-arm-kernel at lists.infradead.org
> > Cc: Dave Martin; Tony Lindgren; Santosh Shilimkar; Jean Pihet;
> > linux-omap at vger.kernel.org; Nicolas Pitre; Russell King
> > Subject: [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7
> > processors
> >
> > 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")
> This is not true for "CPU_32v6K" extensions, right. I think they do
> support 'sev' and 'wfe' instructions.
>
>
Ignore the comment. 'CPU_32v6K' is already considered.

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

end of thread, other threads:[~2011-02-08  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04 14:20 [PATCH] ARM: Define wfi(), wfe(), sev() macros for pre-v7 processors Dave Martin
2011-02-08  8:40 ` Santosh Shilimkar
2011-02-08  8:45 ` Santosh Shilimkar

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).