From patchwork Wed Oct 9 14:29:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3009161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28BF0BF924 for ; Wed, 9 Oct 2013 14:31:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04C222010C for ; Wed, 9 Oct 2013 14:31:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0AD6200F7 for ; Wed, 9 Oct 2013 14:31:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTumq-0005I5-If; Wed, 09 Oct 2013 14:30:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTumg-0004tn-NN; Wed, 09 Oct 2013 14:30:42 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTumM-0004qQ-Ko for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2013 14:30:24 +0000 Received: from e103592.cambridge.arm.com (e103592.cambridge.arm.com [10.1.203.33]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id r99ETrZm001453; Wed, 9 Oct 2013 15:29:54 +0100 From: Dave Martin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 1/4] ARM: Allow assembler.h to be used with inline asm Date: Wed, 9 Oct 2013 15:29:50 +0100 Message-Id: <1381328993-12724-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381328993-12724-1-git-send-email-Dave.Martin@arm.com> References: <1381328993-12724-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131009_103022_968318_9B735DFE X-CRM114-Status: GOOD ( 11.26 ) X-Spam-Score: -2.8 (--) Cc: Nicolas Pitre , Lorenzo Pieralisi , Ben Dooks , Victor Kamensky X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are a few things in assembler.h that would be useful with inline asm, but currently assembler.h refuses to be included into C files. In particular, the optional feature macros (PLD() and friends) can be used sensibly with inline asm, with a string argument. This patch enables the relevant parts of aassembler.h to be included in C files and used in inline asm. Since assembler.h by definition can't be included in any C file up to now, this should not introduce any namespace clashes. Signed-off-by: Dave Martin --- arch/arm/include/asm/assembler.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index fcc1b5b..a71d117 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -16,14 +16,12 @@ #ifndef __ASM_ASSEMBLER_H__ #define __ASM_ASSEMBLER_H__ -#ifndef __ASSEMBLY__ -#error "Only include this from assembly code" -#endif - #include #include #include +#ifdef __ASSEMBLY__ + #define IOMEM(x) (x) /* @@ -53,6 +51,8 @@ #define put_byte_3 lsl #0 #endif +#endif /* __ASSEMBLY__ */ + /* * Data preload for architectures that support it */ @@ -77,6 +77,8 @@ #define CALGN(code...) #endif +#ifdef __ASSEMBLY__ + /* * Enable and disable interrupts */ @@ -376,4 +378,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) #endif .endm +#endif /* __ASSEMBLY__ */ + #endif /* __ASM_ASSEMBLER_H__ */