[Bug 126] Add support for attribute to mark data as volatile.
via D.gnu
d.gnu at puremagic.com
Sun Apr 5 08:04:35 PDT 2015
http://bugzilla.gdcproject.org/show_bug.cgi?id=126
Jens Bauer <jens-bugzilla at gpio.dk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jens-bugzilla at gpio.dk
--- Comment #23 from Jens Bauer <jens-bugzilla at gpio.dk> ---
(In reply to Johannes Pfau from comment #22)
> The volatileLoad/Store intrinsics will have to suffice.
Are these guaranteed to be in the specified order for volatileLoad/Store,
assuming a, b, c and d are different memory locations:
read a
write b
read c
read d
-Or would the compiler be able to mess up the order ?
I believe it's important to be able to keep the order exactly, so that you can
transfer data using several ports.
Simple (pseudo-code) example: SWD protocol
SWDIO_DIR = 0; /* data direction = input */
SWCLK = 0; /* clock pin low */
i = SWDIO; /* read data */
SWCLK = 1; /* clock pin high */
SWDIO_DIR = 1; /* data direction = output */
SWDIO = o; /* write bit 'o' */
SWCLK = 0; /* clock pin low */
cast(void)SWDIO; /* read value but throw it away. (this delay is required) */
SWCLK = 1; /* clock pin high */
... A much more advanced example would be to have multiple clock pins and
multiple ports where we read/write many bits on each port.
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150405/4336b10a/attachment-0001.html>
More information about the D.gnu
mailing list