Re: [PATCH] [2.5] asm-generic/atomic.h and changes to arm, parisc,

Alan Cox (alan@lxorguk.ukuu.org.uk)
09 Aug 2002 00:45:50 +0100


On Thu, 2002-08-08 at 23:11, Luca Barbieri wrote:
> - Had inline assembly for things the compiler should be able to generate
> on its own

The compiler is free to generate them several other ways

> - Didn't work on SMP (irrelevant in practice, but we already need that
> in asm-generic/atomic.h for parisc so m68k gets it for free)

Doesn't matter

> The actual assembly generated should be the same and the header is
> shorter.

Possibly not - volatile doesnt guarantee the compiler won't do

x = 1
add *p into x
store x into *p

The general idea looks fine, but you can't drop asm stuff for volatile C
and be sure you will get away with it. On M68K it works because the
instructions it forces are those guaranteed to be indivisible relative
to an interrupt. You lose that assumption.

-
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/