From patchwork Mon Nov 11 08:10:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3166571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B80569F3A0 for ; Mon, 11 Nov 2013 08:12:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A05CA201F0 for ; Mon, 11 Nov 2013 08:12:26 +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 88922201EF for ; Mon, 11 Nov 2013 08:12:25 +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 1Vfmau-0001q7-GL; Mon, 11 Nov 2013 08:11:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vfmaj-0007mW-Aq; Mon, 11 Nov 2013 08:11:25 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfmaX-0007kl-CI for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2013 08:11:14 +0000 Received: by mail-pd0-f171.google.com with SMTP id w10so4867178pde.16 for ; Mon, 11 Nov 2013 00:10:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YGa5psAWbURrQtXi6np+qpZcrJ+lsMUONaw7WH+udW8=; b=aAEIkxJxjiAInLwh/9uZfNsKSBbWvcU6R89QwTso29tP8QhrrCkZCMejzpe019hLkZ yiRKgrQfkG/A2UAyfjfEauOrhuJIC/CMJMgzngQKAfQhWI6d740LzC/klPyQ0gVD5EZ8 ziHu7/NLQXcljt8F+wXuJw9iLHENuOfyr5yAxtEYpoH1Y7dOhH5CuYtU6zithGjVdHmg BDw21v+BAALG6PIlsIKxhf7IE+PrRF7kRqt5ihP0dvUgYawnV7CIozzJ9a7sPcjPuBZj BPoWtfxbsA0S6rOQFKn3wzMkFMUF9ypjNgC/rLK5AcT2r7fqFhpyl9S8ZlKOXSmfcW1t gayQ== X-Gm-Message-State: ALoCoQlMH/tBZ0rMljRT+mLxYeeveNTytpPogazdLF8SYfqMOwAC0TjRVEx37SPYrdRQAjD393j7 X-Received: by 10.66.124.138 with SMTP id mi10mr4753030pab.141.1384157451729; Mon, 11 Nov 2013 00:10:51 -0800 (PST) Received: from kamensky-w530.cisco.com.net (c-24-6-79-41.hsd1.ca.comcast.net. [24.6.79.41]) by mx.google.com with ESMTPSA id kd1sm33892668pab.20.2013.11.11.00.10.50 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2013 00:10:51 -0800 (PST) From: Victor Kamensky To: linux-arm-kernel@lists.infradead.org, ben.dooks@codethink.co.uk, u.kleine-koenig@pengutronix.de Subject: [PATCH] ARM: signal: fix armv7-m build issue in sigreturn_codes.S Date: Mon, 11 Nov 2013 00:10:27 -0800 Message-Id: <1384157427-31613-2-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1384157427-31613-1-git-send-email-victor.kamensky@linaro.org> References: <1384157427-31613-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131111_031113_548554_70F2DC25 X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) Cc: nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org, taras.kondratiuk@linaro.org, Victor Kamensky , will.deacon@arm.com, Dave.Martin@arm.com, rmk@arm.linux.org.uk 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.2 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 In case of armv7-m architecture arm instructions are not allowed. For this architecture CONFIG_CPU_THUMBONLY is set. Use this macro to emit conditionally arm instructions or nops in thumb mode. Signed-off-by: Victor Kamensky --- arch/arm/kernel/sigreturn_codes.S | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/arch/arm/kernel/sigreturn_codes.S b/arch/arm/kernel/sigreturn_codes.S index 3c5d0f2..899fb86 100644 --- a/arch/arm/kernel/sigreturn_codes.S +++ b/arch/arm/kernel/sigreturn_codes.S @@ -41,17 +41,29 @@ .arch armv4t #endif +/* + * In CPU_THUMBONLY kernel case arm opcodes are not allowed + */ +#ifndef CONFIG_CPU_THUMBONLY +#define ARM_INSTR(code...) .arm ; \ + code +#else +#define ARM_INSTR(code...) .thumb ; \ + nop ; \ + nop ; +#endif + .section .rodata .global sigreturn_codes .type sigreturn_codes, #object - .arm + .align sigreturn_codes: /* ARM sigreturn syscall code snippet */ - mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) - swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) +ARM_INSTR(mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE)) +ARM_INSTR(swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE)) /* Thumb sigreturn syscall code snippet */ .thumb @@ -59,9 +71,8 @@ sigreturn_codes: swi #0 /* ARM sigreturn_rt syscall code snippet */ - .arm - mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) - swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) +ARM_INSTR(mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE)) +ARM_INSTR(swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE)) /* Thumb sigreturn_rt syscall code snippet */ .thumb @@ -74,7 +85,7 @@ sigreturn_codes: * it is thumb case or not, so we need additional * word after real last entry. */ - .arm + .align .space 4 .size sigreturn_codes, . - sigreturn_codes