Working of __asm__ __volatile__ (“” : : : “memory”)
What basically __asm__ __volatile__ () does and what is significance of "memory" for ARM architecture? asm volatile("" ::: "memory"); creates a compiler level memory barrier forcing optimizer to not re-order memory accesses across the barrier. For example, if you need to access some address in a specific order (probably because that memory area is actually backed by a different device rather than a memory) you need to be able tell this to the compiler otherwise it may just optimize your steps for the sake of efficiency. Assume in this scenario you must increment a value in address, read