From: Ben Dooks Date: Fri, 13 Jun 2025 16:12:58 +0000 (+0100) Subject: riscv: byteorder: add test for big-endian X-Git-Tag: v2025.10-rc1~134^2~1^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=364627596c7142d837912acea0d785ecdfeab676;p=thirdparty%2Fu-boot.git riscv: byteorder: add test for big-endian Test for big-endian either via __RISCVEB__ which migth be rather old, or check the BYTE_ORDER if the compiler defines it (which should be any modern gcc like v12) Signed-off-by: Ben Dooks Acked-by: Leo Yu-Chi Liang --- diff --git a/arch/riscv/include/asm/byteorder.h b/arch/riscv/include/asm/byteorder.h index d26ac5688fa..3140c1f585e 100644 --- a/arch/riscv/include/asm/byteorder.h +++ b/arch/riscv/include/asm/byteorder.h @@ -26,7 +26,7 @@ # define __SWAB_64_THRU_32__ #endif -#ifdef __RISCVEB__ +#if defined(__RISCVEB__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) #include #else #include