From patchwork Fri Feb 21 04:44:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25097 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA7D7203BE for ; Fri, 21 Feb 2014 04:45:15 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf7133931pbb.1 for ; Thu, 20 Feb 2014 20:45:14 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=IuyMwAHP6v/7VX5sdKHITu5+ePfW+0bNaNjgMSzTQEw=; b=lYCp8A480gJ1u5WrX2AnB22GjEzTz84rsOpwTdBNSzoZ7M5LOD99yUEHwGM5mqFTIb B4f8njs50yz2iluiv0zUNr7PGImEp3P254ooJmNc1iZs9JL+MvyxzYs+EiwXBZjE60Nt gUzKGTWebYVDS0TrhgaDd409kCmlwra2OtTZKfzCjADauzczrJFfzQsUCnbheJI3hIbt coRwXT1JLP8xOLSr212gz3ZHmOQpipku9+1jVLL+Fvu+jFz1zmp6lw0u7WO2MGAoIYeC GSP2gNni1/9qudGuDP859s4AHXNcVka8pV83NRoRmRCtiBdLpd5TcW1YPc7U/+BIOjIv uEiA== X-Gm-Message-State: ALoCoQlqXiRwjZxR6d0zX5ieUBI7LDxwRnbgCejag+HkRGFE09FV88W/2EdhVKeAbz5zUgr8/4sn X-Received: by 10.66.146.65 with SMTP id ta1mr2618966pab.19.1392957914361; Thu, 20 Feb 2014 20:45:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls829428qgc.56.gmail; Thu, 20 Feb 2014 20:45:14 -0800 (PST) X-Received: by 10.52.84.102 with SMTP id x6mr2869488vdy.49.1392957914117; Thu, 20 Feb 2014 20:45:14 -0800 (PST) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [2607:f8b0:400c:c01::234]) by mx.google.com with ESMTPS id yv5si2520183veb.102.2014.02.20.20.45.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:45:14 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::234; Received: by mail-ve0-f180.google.com with SMTP id cz12so1513771veb.25 for ; Thu, 20 Feb 2014 20:45:14 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr3515831vco.18.1392957913965; Thu, 20 Feb 2014 20:45:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp5030vcz; Thu, 20 Feb 2014 20:45:13 -0800 (PST) X-Received: by 10.68.226.200 with SMTP id ru8mr6636658pbc.77.1392957913082; Thu, 20 Feb 2014 20:45:13 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id io5si6494566pbc.114.2014.02.20.20.45.12; Thu, 20 Feb 2014 20:45:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753060AbaBUEpD (ORCPT + 26 others); Thu, 20 Feb 2014 23:45:03 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:48971 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752494AbaBUEpB (ORCPT ); Thu, 20 Feb 2014 23:45:01 -0500 Received: by mail-pd0-f170.google.com with SMTP id p10so2773079pdj.29 for ; Thu, 20 Feb 2014 20:45:00 -0800 (PST) X-Received: by 10.68.162.66 with SMTP id xy2mr6840861pbb.46.1392957900441; Thu, 20 Feb 2014 20:45:00 -0800 (PST) Received: from galdor.makerspace.ca ([204.239.216.30]) by mx.google.com with ESMTPSA id yg4sm40265819pab.19.2014.02.20.20.44.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:44:59 -0800 (PST) From: behanw@converseincode.com To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, peterz@infradead.org, ak@linux.intel.com, oleg@redhat.com Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Behan Webster Subject: [PATCH] x86: LLVMLinux: Reimplement current_stack_pointer without register usage. Date: Thu, 20 Feb 2014 20:44:42 -0800 Message-Id: <1392957882-24105-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::234 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; dkim=neutral (bad format) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Behan Webster Use asm to make the globally named register work again for gcc and clang. Much more efficient than copying the stack pointer to a variable and back again. Signed-off-by: Behan Webster --- arch/x86/include/asm/thread_info.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index e1940c0..e27ccc1 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -163,10 +163,10 @@ struct thread_info { */ #ifndef __ASSEMBLY__ -#define current_stack_pointer ({ \ - unsigned long sp; \ - asm("mov %%esp,%0" : "=g" (sp)); \ - sp; \ +#define current_stack_pointer ({ \ + register unsigned long sp asm("esp") __used; \ + asm("" : "=r" (sp)); \ + sp; \ }) /* how to get the thread information struct from C */