aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/riscv/include/arch
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2015-02-23 14:31:09 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-21 08:23:25 +0200
commit9ff8f6f818d4e5a8aa0fe21cbfaba9ccd865bc7b (patch)
treebc668e3ddf5f0abf9fc5c5f7911e29895bee46a6 /src/arch/riscv/include/arch
parent941847652406982f3c9944fdd98cce4029b533fb (diff)
downloadcoreboot-9ff8f6f818d4e5a8aa0fe21cbfaba9ccd865bc7b.tar.gz
coreboot-9ff8f6f818d4e5a8aa0fe21cbfaba9ccd865bc7b.tar.xz
coreboot-9ff8f6f818d4e5a8aa0fe21cbfaba9ccd865bc7b.zip
Unify byte order macros and clrsetbits
This patch removes quite a bit of code duplication between cpu_to_le32() and clrsetbits_le32() style macros on the different architectures. This also syncs those macros back up to the new write32(a, v) style IO accessor macros that are now used on ARM and ARM64. CQ-DEPEND=CL:254862 BRANCH=none BUG=chromium:444723 TEST=Compiled Cosmos, Daisy, Blaze, Falco, Pinky, Pit, Rambi, Ryu, Storm and Urara. Booted on Jerry. Tried to compare binary images... unfortunately something about the new macro notation makes the compiler evaluate it more efficiently (not recalculating the address between the read and the write), so this was of limited value. Change-Id: If8ab62912c952d68a67a0f71e82b038732cd1317 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: fd43bf446581bfb84bec4f2ebb56b5de95971c3b Original-Change-Id: I7d301b5bb5ac0db7f5ff39e3adc2b28a1f402a72 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/254866 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9838 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/riscv/include/arch')
-rw-r--r--src/arch/riscv/include/arch/byteorder.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/arch/riscv/include/arch/byteorder.h b/src/arch/riscv/include/arch/byteorder.h
index 8dc069f48..3478bdb3c 100644
--- a/src/arch/riscv/include/arch/byteorder.h
+++ b/src/arch/riscv/include/arch/byteorder.h
@@ -3,25 +3,4 @@
#define __LITTLE_ENDIAN 1234
-#include <stdint.h>
-#include <swab.h>
-
-#define cpu_to_le64(x) ((uint64_t)(x))
-#define le64_to_cpu(x) ((uint64_t)(x))
-#define cpu_to_le32(x) ((uint32_t)(x))
-#define le32_to_cpu(x) ((uint32_t)(x))
-#define cpu_to_le16(x) ((uint16_t)(x))
-#define le16_to_cpu(x) ((uint16_t)(x))
-#define cpu_to_be64(x) swab64(x)
-#define be64_to_cpu(x) swab64(x)
-#define cpu_to_be32(x) swab32((x))
-#define be32_to_cpu(x) swab32((x))
-#define cpu_to_be16(x) swab16((x))
-#define be16_to_cpu(x) swab16((x))
-
-#define ntohll(x) be64_to_cpu(x)
-#define htonll(x) cpu_to_be64(x)
-#define ntohl(x) be32_to_cpu(x)
-#define htonl(x) cpu_to_be32(x)
-
#endif /* _BYTEORDER_H */