From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 3 Dec 2012 15:39:22 +0100 Subject: [U-Boot] [PATCH 1/2] ARM: add wfi assembly macro In-Reply-To: <50BCA9E2.1000001@gmail.com> References: <1354503982-1124-1-git-send-email-robherring2@gmail.com> <201212030558.02974.marex@denx.de> <50BCA9E2.1000001@gmail.com> Message-ID: <201212031539.22757.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Rob Herring, > On 12/02/2012 10:58 PM, Marek Vasut wrote: > > Dear Rob Herring, > > > >> From: Rob Herring > >> > >> Since wfi instruction is only available on ARMv7, add a conditional > >> macro for it. > >> > >> Signed-off-by: Rob Herring > >> --- > >> > >> arch/arm/include/asm/system.h | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/arch/arm/include/asm/system.h > >> b/arch/arm/include/asm/system.h index 2b28a26..2f6aecd 100644 > >> --- a/arch/arm/include/asm/system.h > >> +++ b/arch/arm/include/asm/system.h > >> @@ -61,6 +61,12 @@ > >> > >> #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); > >> > >> +#ifdef __ARM_ARCH_7A__ > >> +#define wfi() __asm__ __volatile__ ("wfi" : : : "memory") > >> +#else > >> +#define wfi() > >> +#endif > > > > Won't this break other (non-arm) systems? Moreover, maybe you can make > > this an (inline) function instead? > > How? It is in an ARM specific header and empty on anything but ARMv7 > enabled compiler. This follows the kernel implementation and the nop above. Ok, I missed the arch/arm. It's ok then, sorry for the noise. [...] Best regards, Marek Vasut