Synchronization of Stores and Loads to I/O Space

Stores and loads to I/O space must be separated from other store and load operations by synchronization instructions. These synchronization instructions allow the compiler to synchronize the execution of the code block.

IBM C/C++ Compilers provides two built-in functions that you can use to specify the type of synchronization, and where and how it should take place.

For C source programs, the two functions are:

Use the function __iospace_eieio (Enforced In-order Execution for I/O) when you want to synchronize cache-inhibited memory-mapped I/O.

Use the function __iospace_sync (I/O Space Synchronization) when all the multiple dispatch capabilities of the processor must be synchronized.

To use these built-in functions effectively, you should use pointers to volatile to access device registers, and then place either of these built-in functions at the completion of this access section of your code.



Example of Reading and Writing to Mapped-to-I/O Space
Example of Multiple Writes to a Single Register


Implementation Dependencies