From patchwork Thu Feb 17 12:42:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 163 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:40:27 -0000 Delivered-To: patches@linaro.org Received: by 10.146.25.23 with SMTP id 23cs47521yay; Thu, 17 Feb 2011 04:44:26 -0800 (PST) Received: by 10.216.141.75 with SMTP id f53mr1556150wej.16.1297946665340; Thu, 17 Feb 2011 04:44:25 -0800 (PST) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id m29si1108818wej.135.2011.02.17.04.44.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Feb 2011 04:44:25 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by wyb42 with SMTP id 42so2410392wyb.37 for ; Thu, 17 Feb 2011 04:44:24 -0800 (PST) Received: by 10.227.135.129 with SMTP id n1mr1660950wbt.19.1297946664785; Thu, 17 Feb 2011 04:44:24 -0800 (PST) Received: from e200948.cambridge.arm.com (host86-144-161-218.range86-144.btcentralplus.com [86.144.161.218]) by mx.google.com with ESMTPS id f27sm691137wbf.13.2011.02.17.04.44.23 (version=SSLv3 cipher=OTHER); Thu, 17 Feb 2011 04:44:24 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: Dave Martin , Tony Lindgren , Santosh Shilimkar , Jean Pihet , Kevin Hilman , linux-omap@vger.kernel.org, Nicolas Pitre , linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH v5 1/5] ARM: omap4: Provide do_wfi() for Thumb-2 Date: Thu, 17 Feb 2011 12:42:34 +0000 Message-Id: <1297946558-13436-2-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297946558-13436-1-git-send-email-dave.martin@linaro.org> References: <1297946558-13436-1-git-send-email-dave.martin@linaro.org> For CONFIG_THUMB2_KERNEL, the existing definition of do_wfi() will insert invalid code into the instruction stream. Any assembler which can assemble Thumb-2 is guaranteed to accept the "wfi" mnemonic, so for the Thumb-2 case, just use the mnemonic. The ARM case is left as-is. Signed-off-by: Dave Martin --- arch/arm/mach-omap2/include/mach/omap4-common.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index 5b0270b..de441c0 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h @@ -17,8 +17,12 @@ * wfi used in low power code. Directly opcode is used instead * of instruction to avoid mulit-omap build break */ +#ifdef CONFIG_THUMB2_KERNEL +#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory") +#else #define do_wfi() \ __asm__ __volatile__ (".word 0xe320f003" : : : "memory") +#endif #ifdef CONFIG_CACHE_L2X0 extern void __iomem *l2cache_base;