Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263449AbUJ2SWa (ORCPT ); Fri, 29 Oct 2004 14:22:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263458AbUJ2SWT (ORCPT ); Fri, 29 Oct 2004 14:22:19 -0400 Received: from fw.osdl.org ([65.172.181.6]:47782 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S263449AbUJ2SSs (ORCPT ); Fri, 29 Oct 2004 14:18:48 -0400 Date: Fri, 29 Oct 2004 11:18:33 -0700 (PDT) From: Linus Torvalds To: Andi Kleen cc: linux-os@analogic.com, Kernel Mailing List , Richard Henderson , Andrew Morton , Jan Hubicka Subject: Re: Semaphore assembly-code bug In-Reply-To: <20041029151139.GA73646@muc.de> Message-ID: References: <417550FB.8020404@drdos.com> <1098218286.8675.82.camel@mentorng.gurulabs.com> <41757478.4090402@drdos.com> <20041020034524.GD10638@michonline.com> <1098245904.23628.84.camel@krustophenia.net> <1098247307.23628.91.camel@krustophenia.net> <20041029151139.GA73646@muc.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 31 On Fri, 29 Oct 2004, Andi Kleen wrote: > > > Richard, Jan, Andi? Or does it already exist somewhere? > > How about just using __attribute__((regparm(1))) ? Then the > problem doesn't appear. Yes, we could use regparm for all assembly. Right now "asmlinkage" actually _disables_ regparm so that we always have the same calling convention for assembly regardless of whether the rest of the kernel is compiled with regparm or not, but we could certainly change that #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) to use "regparm(3)" instead. I guess it's stable these days, since we use it for FASTCALL() and friends too. > Would be faster too. It should work reliable on all supported compilers. What's happens if there are more arguments than three? It happens for several system calls - does gcc still consider the stack part of the thing to be owned by the callee? Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/