27 November 2019, 14:05 | #1 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Are "memory barriers" needed with GCC?
Of late I've grown increasingly suspicious that the enabling and disabling of interrupts around the sensitive parts of my code wasn't working as expected. Looking into it, GCC is happy to rearrange bits of code as it sees fit, the only real exception being accesses to things marked volatile, which it will keep in order (relative to other volatile things).
So, if I have code like: Code:
extern volatile struct Custom * custom; ... custom->intena = INTF_INTEN; Event * event = (Event *) Queue_Dequeue(&eventQueue); custom->intena = INTF_SETCLR | INTF_INTEN; Code:
asm volatile ("" ::: "memory"); Edit: The answer is "Yes". Last edited by deimos; 28 November 2019 at 17:33. |
27 November 2019, 17:51 | #2 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Just found this: https://gcc.gnu.org/onlinedocs/gcc/Volatiles.html
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Diabolik" & "Dylan Dog" & "Tex" & "Time Runners" series | DamienD | request.Old Rare Games | 20 | 21 July 2022 16:58 |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
WHDLoad, Alien Breed 3D TKG "Not enough chip memory!" | kris2222 | support.Games | 4 | 27 April 2019 15:48 |
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" | rockape | News | 4 | 30 January 2013 00:06 |
Old cache memory as a "base" for GVP memory | rkauer | Hardware pics | 4 | 22 November 2008 06:23 |
|
|