Two questions about IPC and possible race conditions:
1) Do we need any Data memory barriers at all in order to make sure that all writes are visible to the other core when setting an IPC flag. For example, consider the code:
HWREG( MTOCIPC_BASE + IPC_O_MTOCIPCCOM ) = 0xAA; // Set a command "0xAA" in the "M3 To C28 IPC Command Register"
HWREG( MTOCIPC_BASE + IPC_O_MTOCIPCSET ) |= IPC_FLAG1; // Notify C28x about the new command by setting dedicated flag
Do I need to place __asm(" dmb\n"); in between these two code lines to ensure 0xAA is visible before the flag is set?
2) My second question is wheter setting and clearing of IPC flags is guaranteed to be atomic and interrupt safe on both cores. For example, if an ARM cortex interrupt/process is in the process of setting one flag and then preempted by a higher priority ARM cortex interrupt which sets another IPC flag, can this produce unexpected results?