On 12/1/24 13:47, Nicklas SB Karlsson wrote:
There should be a review to look into the other instances of volatile.
I've seen the use of some atomics/memory barriers in the code, but there
are many pointers used where volatile changes the code's load/store
behavior, which may be essential for shared memory to work properly.
If I think right all accesses to shared memory should be volatile.
Otherwise a read or write is not guaranteed.
I fully agree.

Without volatile you cannot guarantee any reads or writes to be performed to (shared) memory. The compiler may remove any and all non-volatile load/store operations as an optimization if it sees fit.

I did check all instances where hal_port_t was used and there I could be sure that volatile could be removed.

As said, the rest needs a thorough review.

--
Greetings Bertho

(disclaimers are disclaimed)



_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to