From patchwork Fri Sep 6 21:28:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 273336 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4AB0C2C0107 for ; Sat, 7 Sep 2013 07:32:07 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VI3cl-0008CW-86; Fri, 06 Sep 2013 21:31:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VI3cZ-0000ZU-UB; Fri, 06 Sep 2013 21:31:16 +0000 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VI3cW-0000Xq-Af for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2013 21:31:12 +0000 Received: by mail-ie0-f173.google.com with SMTP id qa5so6662984ieb.4 for ; Fri, 06 Sep 2013 14:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=converseincode.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=EfKa036+5PK1ZZKpfecTTs9lebdC0njdHNEEw7yMzig=; b=Uf3VQoFnazVm33gsaL0LscBeYju0sHeqf0o/cp06/1+k13u2AB4ZzBoo5kx+hUfmpj vFyTsnDVTQ7Jy9C5DMbVCkXVNuQPKoXmBMnnrvYhWQGcZgsh8sR6xkHQJTeX5RYmptIO ni0cmcFvZ4udAT93lts/8yBFvrdZEX4pFmGN8= 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:mime-version:content-type:content-transfer-encoding; bh=EfKa036+5PK1ZZKpfecTTs9lebdC0njdHNEEw7yMzig=; b=UWzQsfoamLxQqIY19ikCEHgEgqW8Z/PZQ549czBn+tqS9vpHoCeoga25tbv906jatf hr1FUiprwT2JOBJ3tgGWJEuc7K6lL5BR+qPq6PJbrctqkfEJYBQPQ7/JX+UnuQqWa8Md OHyA+Tt30ofHRVVLVdJbOK5xnfCAsOF9WwPpsFYGvFSzBqBCiqfumrEsM5c2e4hs7TQj dIO4Ssuphh0zUiF4nZMUQ68G+gDOhsaqhBX2qOnRz/mAaovbOWC4g8tIj9TRh9K0gKzO w86mBwpjpKiJGK3Awmdqt4jQAkgM8HEX5lVYKNa4t6nFH+3dCRm3KG9kRH3NoCuvT7hI b1xQ== X-Gm-Message-State: ALoCoQnHF+Ko+fWkPF80tOu5QYBCj4pIMMSpNp+jH0N6hMSJlAFxsdL9lyUP9RZ8vwSSAyEzsgA3 X-Received: by 10.43.125.4 with SMTP id gq4mr2861845icc.1.1378503051253; Fri, 06 Sep 2013 14:30:51 -0700 (PDT) Received: from galdor.websterwood.com (216-58-123-51.cpe.distributel.net. [216.58.123.51]) by mx.google.com with ESMTPSA id i1sm605871iga.0.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Sep 2013 14:30:50 -0700 (PDT) From: behanw@converseincode.com To: linux@arm.linux.org.uk Subject: [PATCH 3/5] arm: LLVMLinux: Use current_stack_pointer for return_address Date: Fri, 6 Sep 2013 17:28:09 -0400 Message-Id: <1378502899-1241-4-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1378502899-1241-1-git-send-email-behanw@converseincode.com> References: <1378502899-1241-1-git-send-email-behanw@converseincode.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130906_173112_403913_A8B4FED1 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Sahara , Dave Martin , open list , Mark Charlebois , =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= , "moderated list:ARM PORT" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Behan Webster The existing code uses named registers to get the value of the stack pointer. The new current_stack_pointer macro is more readable and allows for a central portable implementation of how to get the stack pointer with ASM. This change supports being able to compile the kernel with both gcc and Clang. Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster Reviewed-by: Jan-Simon Möller --- arch/arm/kernel/return_address.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c index fafedd8..5bceaef 100644 --- a/arch/arm/kernel/return_address.c +++ b/arch/arm/kernel/return_address.c @@ -39,13 +39,12 @@ void *return_address(unsigned int level) { struct return_address_data data; struct stackframe frame; - register unsigned long current_sp asm ("sp"); data.level = level + 2; data.addr = NULL; frame.fp = (unsigned long)__builtin_frame_address(0); - frame.sp = current_sp; + frame.sp = current_stack_pointer; frame.lr = (unsigned long)__builtin_return_address(0); frame.pc = (unsigned long)return_address;