bswap: Add new stn_*_p() and ldn_*_p() memory access functions
commitafa4f6653dca095f63f3fe7f2001e9334f5676c1
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Jun 2018 13:57:14 +0000 (15 14:57 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Jun 2018 14:23:34 +0000 (15 15:23 +0100)
tree5d3b9c27711a2b3ef5eaa2635593921092e32ae9
parent2948f0cde3974185ad22d6721438cf85df852877
bswap: Add new stn_*_p() and ldn_*_p() memory access functions

There's a common pattern in QEMU where a function needs to perform
a data load or store of an N byte integer in a particular endianness.
At the moment this is handled by doing a switch() on the size and
calling the appropriate ld*_p or st*_p function for each size.

Provide a new family of functions ldn_*_p() and stn_*_p() which
take the size as an argument and do the switch() themselves.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180611171007.4165-2-peter.maydell@linaro.org
docs/devel/loads-stores.rst
include/exec/cpu-all.h
include/qemu/bswap.h