Add 'volatile' qualifier to new CSR accessors
authorGabriel Somlo <gsomlo@gmail.com>
Thu, 6 Feb 2020 23:30:22 +0000 (18:30 -0500)
committerGabriel Somlo <gsomlo@gmail.com>
Fri, 21 Feb 2020 19:10:13 +0000 (14:10 -0500)
commit173117ad4b7c84d6f591bf7a4f916301c7dc1d06
tree3a496bb5090ad0d6ee20e07bacc1706c0c1ec0c4
parent485934edc9c1e123e3e39911b910b51aa3196b19
Add 'volatile' qualifier to new CSR accessors

Through their use of the MMPTR() macro, the "classic"
csr_[read|write]simple() accsessors identify the MMIO
subregister with the 'volatile' qualifier.

Adjust the new, csr_[rd|wr]_uint[8|16|32|64]() accessors
to also utilize the 'volatile' qualifier. Since accesses
are implicit (a[i], where a is an 'unsigned long *'),
change 'a' to be a 'volatile unsigned long *' instead.

No difference was noticed in opcodes generated using the
gcc9 risc-v cross-compiler on x86_64 with standard LiteX
cflags (vexriscv and rocket were tested), but since
reports exist that 'volatile' matters on some combinations
of compilers and targets, add the 'volatile' qualifier just
to be on the safe side.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com
litex/soc/software/include/hw/common.h