[PATCH][v2] atomic_dec_if_positive sign extension fix
Gabriel Paubert
paubert at iram.es
Wed Jan 17 07:08:38 EST 2007
On Tue, Jan 16, 2007 at 12:16:05PM -0600, Robert Jennings wrote:
> Paul,
>
> Here is v.2 for the patch.
> Please apply for 2.6.20. If an atomic counter is explicitly set to a
> negative value the atomic_dec_if_positive function will decrement and
> store the next smallest value in the atomic counter contrary to it's
> intended operation.
>
> The comparison to determine if the decrement will make the result
> negative is done by the "addic." operation which operates on a 64-bit
> value. I've changed the addic to an addi (changing "=&r" to "=&g" in
I think the proper constraint is "=&b".
Gabriel
More information about the Linuxppc-dev
mailing list