From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbcEXGJR (ORCPT ); Tue, 24 May 2016 02:09:17 -0400 Received: from gate.crashing.org ([63.228.1.57]:52205 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbcEXGJQ (ORCPT ); Tue, 24 May 2016 02:09:16 -0400 Date: Tue, 24 May 2016 01:08:39 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: inline current_stack_pointer() Message-ID: <20160524060839.GA6492@gate.crashing.org> References: <20160523084602.53F771A239A@localhost.localdomain> <20160523202214.GB11583@gate.crashing.org> <61305e9e-ed63-6915-709c-dd8797ff1fba@c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61305e9e-ed63-6915-709c-dd8797ff1fba@c-s.fr> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 24, 2016 at 07:39:59AM +0200, Christophe Leroy wrote: > >>+static inline unsigned long current_stack_pointer(void) > >>+{ > >>+ register unsigned long *ptr asm("r1"); > >>+ > >>+ return *ptr; > >>+} > >Register asm is only guaranteed to work as input to inline asm. NAK. > > > Does it mean that the following declaration in > arch/powerpc/include/asm/paca.h is wrong too ? > > register struct paca_struct *local_paca asm("r13"); That one is fine, because it is a global var. https://gcc.gnu.org/onlinedocs/gcc/Explicit-Register-Variables.html Segher