Re: [PATCH] De-macro spin_trylock_irq, spin_trylock_irqsave,write_trylock_irqsave

From: Linus Torvalds
Date: Sat Aug 16 2008 - 17:21:57 EST




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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/