From patchwork Wed Aug 27 04:29:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 383317 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2AD64140088 for ; Wed, 27 Aug 2014 14:32:19 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMUsM-0000VG-EO; Wed, 27 Aug 2014 04:30:26 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMUs3-0007OS-CK for linux-arm-kernel@lists.infradead.org; Wed, 27 Aug 2014 04:30:08 +0000 Received: by mail-pa0-f48.google.com with SMTP id et14so24638020pad.21 for ; Tue, 26 Aug 2014 21:29:48 -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=k5zPtfTmPeFrNZgTog//7MDmowfvCgmJcNaBJ5a1n5s=; b=hhPt6dBs8W7pf/9IAv88juHG0djk8FnDqUUYUhmSqY95jpqQFUOvc5ISsD9wHQ/I78 7DPL4A4CqeQn3VkSL0FRjXKL3l4njho1t163gd4Fn4rBENpmjXxjfKjZxXYLzeQO5vI0 TvjAx9B5qovZa7FXD+d6HZJV7eONru/o65osg= 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=k5zPtfTmPeFrNZgTog//7MDmowfvCgmJcNaBJ5a1n5s=; b=cwY8EE6Zxx04H/lA7N9hd5orKVMgV641Xzpeqzxr1n39QjbZ5L7HjckbccBJoSVVWE VVIBs1j3AYWabby2V0K7yV4j1bO17rbf4ej+ifDprHoS8nfsGy/FeZ0oGoZc3rcMk2N2 ewL1PXm9oGq7PvhJww+mwih63UJsvR/U5CYAaawMZaR9uxrT9PJAbdbSNRicX/O0G72e RG7bvzNSOG8cxKzNqj5GWthPlRG8JUJXYyBHJWSIqnG9Zrhf1ubkGwxQUYFmRqBtQ757 AE9zeuf8S4ooylmZ8fF82mEISn8+U1bWwAUqGDe1pNjAEeafdpPx7wyICncS1l4L9kWl ZA3A== X-Gm-Message-State: ALoCoQkWeJ0JRmc9E8xENa8lwFKAZCuk8UNkV2oyELdv6JfluOIPQsz3IPKKKdPeP6fQLcLWsAh8 X-Received: by 10.70.129.162 with SMTP id nx2mr42024890pdb.73.1409113788766; Tue, 26 Aug 2014 21:29:48 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id dn5sm5029335pbb.2.2014.08.26.21.29.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 21:29:47 -0700 (PDT) From: behanw@converseincode.com To: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, cl@linux-foundation.org, jays.lee@samsung.com, k.khlebnikov@samsung.com, larry.bassel@linaro.org, olof@lixom.net, peterz@infradead.org, takahiro.akashi@linaro.org, tglx@linutronix.de, tj@kernel.org, will.deacon@arm.com Subject: [PATCH V2 3/6] arm64: LLVMLinux: Calculate current_thread_info from current_stack_pointer Date: Tue, 26 Aug 2014 21:29:31 -0700 Message-Id: <1409113774-3172-4-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409113774-3172-1-git-send-email-behanw@converseincode.com> References: <20140826141608.GT23445@arm.com> <1409113774-3172-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-20140826_213007_459633_833975A0 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Cc: khilman@linaro.org, linux-kernel@vger.kernel.org, kgene.kim@samsung.com, christoffer.dall@linaro.org, Mark Charlebois , sungjinn.chung@samsung.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 Use the global current_stack_pointer to get the value of the stack pointer. This change supports being able to compile the kernel with both gcc and clang. Signed-off-by: Behan Webster Signed-off-by: Mark Charlebois Reviewed-by: Jan-Simon Möller Reviewed-by: Olof Johansson Acked-by: Will Deacon --- arch/arm64/include/asm/thread_info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 356e037..459bf8e 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -80,8 +80,8 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__; static inline struct thread_info *current_thread_info(void) { - register unsigned long sp asm ("sp"); - return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); + return (struct thread_info *) + (current_stack_pointer & ~(THREAD_SIZE - 1)); } #define thread_saved_pc(tsk) \