arm-trusted-firmware/include/lib
Sandrine Bailleux 36e2fd0139 Prevent optimisation of sysregs accessors calls
Calls to system register read accessors functions may be optimised
out by the compiler if called twice in a row for the same register.
This is because the compiler is not aware that the result from
the instruction may be modified by external agents. Therefore, if
nothing modifies the register between the 2 reads as far as the
compiler knows then it might consider that it is useless to read
it twice and emit only 1 call.

This behaviour is faulty for registers that may not have the same
value if read twice in succession. E.g.: counters, timer
control/countdown registers, GICv3 interrupt status registers and
so on.

The same problem happens for calls to system register write
accessors functions. The compiler might optimise out some calls
if it considers that it will produce the same result. Again, this
behaviour is faulty for cases where intermediate writes to these
registers make a difference in the system.

This patch fixes the problem by making these assembly register
accesses volatile.

Fixes ARM-software/tf-issues#273

Change-Id: I33903bc4cc4eea8a8d87bc2c757909fbb0138925
2015-01-07 17:24:47 +00:00
..
aarch64 Prevent optimisation of sysregs accessors calls 2015-01-07 17:24:47 +00:00
cpus/aarch64 Juno: Implement initial platform port 2014-08-21 14:53:48 +01:00
bakery_lock.h Remove calling CPU mpidr from bakery lock API 2014-06-23 23:16:39 +01:00
cassert.h Separate out CASSERT macro into own header 2014-05-06 12:35:02 +01:00
mmio.h Inline the mmio accessor functions 2014-06-24 14:30:23 +01:00
semihosting.h Remove variables from .data section 2014-05-06 17:55:38 +01:00
spinlock.h Always use named structs in header files 2014-05-06 13:57:48 +01:00