[riot-notifications] [RIOT-OS/RIOT] sys/atomic_utils: Use volatile qualifier (#15465)

Marian Buschsieweke notifications at github.com
Wed Nov 18 10:53:00 CET 2020

### Contribution description

This PR marks all pointers in the atomic utils API as `volatile` for the following reasons:

1. The guarantees provided by `volatile` is a subset of the guarantees provided by the atomic utils. This makes this fact more obvious.
2. Casting `volatile` off is undefined behavior. In order to be able to use the atomic utils on memory mapped IO (which needs the `volatile` qualifier) without resorting to undefined behavior, this API change is needed.

### Testing procedure

No changes in binaries.

### Issues/PRs references

Needed for https://github.com/RIOT-OS/RIOT/pull/15074
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * sys/atomic_utils: Use volatile pointers
  * cpu/*/atomic_utils_arch.h: Add volatile qualifier

-- File Changes --

    M cpu/arm7_common/include/atomic_utils_arch.h (12)
    M cpu/atmega_common/include/atomic_utils_arch.h (4)
    M cpu/cortexm_common/include/atomic_utils_arch.h (22)
    M cpu/esp_common/include/atomic_utils_arch.h (12)
    M cpu/fe310/include/atomic_utils_arch.h (12)
    M cpu/mips32r2_common/include/atomic_utils_arch.h (12)
    M cpu/msp430_common/include/atomic_utils_arch.h (8)
    M cpu/native/include/atomic_utils_arch.h (12)
    M sys/include/atomic_utils.h (338)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201118/f030afd2/attachment.htm>

More information about the notifications mailing list