Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754302AbYHPVVz (ORCPT ); Sat, 16 Aug 2008 17:21:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751500AbYHPVVr (ORCPT ); Sat, 16 Aug 2008 17:21:47 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:60092 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbYHPVVq (ORCPT ); Sat, 16 Aug 2008 17:21:46 -0400 Date: Sat, 16 Aug 2008 14:21:41 -0700 (PDT) From: Linus Torvalds To: Alexey Dobriyan cc: Jiri Slaby , akpm@linuxfoundation.org, Linux Kernel Mailing List , "David S. Miller" Subject: Re: [PATCH] De-macro spin_trylock_irq, spin_trylock_irqsave, write_trylock_irqsave In-Reply-To: <20080816204855.GA5151@martell.zuzino.mipt.ru> Message-ID: References: <20080816095951.GA19926@martell.zuzino.mipt.ru> <48A6D694.4070302@gmail.com> <20080816204855.GA5151@martell.zuzino.mipt.ru> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 33 On Sun, 17 Aug 2008, Alexey Dobriyan wrote: > On Sat, Aug 16, 2008 at 03:31:00PM +0200, Jiri Slaby wrote: > > > > Doesn't this break on sparc -- is it tested there? > > What's so special about sparc? Sparc _used_ to save/restore the whole processor flags word with the irq flags. That includes, iirc, things like the register window crap, so if you did a save/restore flags in a function, it would get all that wrong and things would blow up. However, I don't think sparc has actually done that for a _loong_ time now, due to it always being problematic. > >> +static inline int spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags) However, I refuse to see this crap. Like it or not, the 'flags' argument has always been pass-by-reference, and not a pointer. It does that because it used to make a huge difference for gcc code generation and for making it easy to do as a direct inline asm. We're not going to change that. 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/