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

Luca Barbieri (ldb@ldb.ods.org)
12 Aug 2002 14:03:41 +0200


--=-FSGQDFUJR5MQe51Ot+eh
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 2002-08-12 at 13:16, David Woodhouse wrote:
>
> alan@lxorguk.ukuu.org.uk said:
> > Possibly not - volatile doesnt guarantee the compiler won't do
> > x = 1
> > add *p into x
> > store x into *p
>
> Er, AIUI 'volatile' guarantees that '*p++' will do precisely that. It's a
> load, an add and a store, and the rules about volatile mean that the load
> and the store _must_ be separate.

I noticed that while testing how rmk's code behaved differently than
mine (and corrected in the v2 patch).
Before that, I just assumed that since the CPU must anyway issue a
separate load and store, the compiler would use the faster instruction
(that's why there is a LOCK prefix in the i386 instruction set).

--=-FSGQDFUJR5MQe51Ot+eh
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9V6Qcdjkty3ft5+cRAtv4AJ9vHSVBZshyveJpn2CfcMMwVlKHiQCeNFf1
2+25AhFYgCtq6fseSV9usBA=
=pwoL
-----END PGP SIGNATURE-----

--=-FSGQDFUJR5MQe51Ot+eh--
-
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/