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: vkamensky X-Patchwork-Id: 21437 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9505E244E4 for ; Mon, 11 Nov 2013 08:10:53 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id p4sf6362542ggn.3 for ; Mon, 11 Nov 2013 00:10:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=YGa5psAWbURrQtXi6np+qpZcrJ+lsMUONaw7WH+udW8=; b=MyyDGeFlcSLWuKgmUM3V4ANTzPsa+OkaykYe0odycpNmNmXRI0hY5lqng/VkW98rZL 2zU4446ZZM9NMODm34nJ6vyCH/59vZG4NfgV5Z2qaXOyELdRa7EuBZuU6VsHAKXJkg8Y Kdhr3gWkBzxAVsDeQ7KJMHZr9lwW/Y6A+FnAU1EEcLTOs49JK0EgrCPpNJf8ApmBFEZn JAmNE2gwTGTWQUPkbxW7lfm2QKmKxU+SQs/x3v5KoUYXIYxQf2s729EcjYH98y1zUD7C ce1UgM5CIDTC+FCBlqe4LVvUqgXjAH5sXzE3q1UmWWVfPfNBrtvfkn1/2B9i1kw74xkA YeGA== X-Gm-Message-State: ALoCoQliZokxpxcm7d2W5tke41Fs+7PR1J5ib7UZwHB+3H3bwlzsaQ8x0dHgwoRL8nSpNPva0jN4 X-Received: by 10.224.24.65 with SMTP id u1mr20352585qab.6.1384157453174; Mon, 11 Nov 2013 00:10:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.229 with SMTP id j5ls2361083qes.25.gmail; Mon, 11 Nov 2013 00:10:53 -0800 (PST) X-Received: by 10.58.136.231 with SMTP id qd7mr22740913veb.1.1384157453101; Mon, 11 Nov 2013 00:10:53 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id wp10si9166715vdb.71.2013.11.11.00.10.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 00:10:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ie18so2974579vcb.23 for ; Mon, 11 Nov 2013 00:10:53 -0800 (PST) X-Received: by 10.52.52.137 with SMTP id t9mr19443803vdo.22.1384157453000; Mon, 11 Nov 2013 00:10:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp74261vcz; Mon, 11 Nov 2013 00:10:52 -0800 (PST) X-Received: by 10.66.102.9 with SMTP id fk9mr30069176pab.41.1384157452172; Mon, 11 Nov 2013 00:10:52 -0800 (PST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by mx.google.com with ESMTPS id z1si15063672pbn.211.2013.11.11.00.10.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 00:10:52 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.180 is neither permitted nor denied by best guess record for domain of victor.kamensky@linaro.org) client-ip=209.85.192.180; Received: by mail-pd0-f180.google.com with SMTP id v10so776486pde.11 for ; Mon, 11 Nov 2013 00:10:51 -0800 (PST) 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 Cc: rmk@arm.linux.org.uk, nicolas.pitre@linaro.org, Dave.Martin@arm.com, will.deacon@arm.com, taras.kondratiuk@linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Victor Kamensky 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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