On Sun, 22 May 2011 01:47:20 -0700, hamze wrote:
> I know what is my hardware correct order of MMIO, but I dont know how
> to make compiler know about it and force compile not to REORDER my
> code.
The compiler will not re-order reads/writes of volatile variables with
respect to each other. However, the CPU might perform re-ordering; to
prevent this, you need to use a memory barrier (aka "fence").
http://en.wikipedia.org/wiki/Memory_barrier
http://en.wikipedia.org/wiki/Memory_ordering
For gcc, see e.g.:
http://gcc.gnu.org/onlinedocs/gcc-4....-Builtins.html
Also, you might try comp.arch.embedded.