Rebase modes_local.h patch over KNF rampage

This commit is contained in:
Theo Buehler 2023-07-08 14:20:25 -06:00
parent 4aa2efb54d
commit d36f70674f

View File

@ -1,19 +1,16 @@
--- crypto/modes/modes_local.h.orig Tue Nov 14 10:25:15 2017 --- crypto/modes/modes_local.h.orig Sat Jul 8 14:03:53 2023
+++ crypto/modes/modes_local.h Sat Jan 19 22:19:23 2019 +++ crypto/modes/modes_local.h Sat Jul 8 14:10:56 2023
@@ -45,14 +45,16 @@ @@ -45,6 +45,7 @@
asm ("bswapl %0" \ asm ("bswapl %0" \
: "+r"(ret)); ret; }) : "+r"(ret)); ret; })
# elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT) # elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT)
-# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
+# if (__ARM_ARCH >= 6) +# if (__ARM_ARCH >= 6)
+# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
asm ("rev %0,%0; rev %1,%1" \ asm ("rev %0,%0; rev %1,%1" \
: "+r"(hi),"+r"(lo)); \ : "+r"(hi),"+r"(lo)); \
(u64)hi<<32|lo; }) @@ -53,6 +54,7 @@
-# define BSWAP4(x) ({ u32 ret; \ asm ("rev %0,%1" \
+# define BSWAP4(x) ({ u32 ret; \ : "=r"(ret) : "r"((u32)(x))); \
asm ("rev %0,%1" \
: "=r"(ret) : "r"((u32)(x))); \
ret; }) ret; })
+# endif +# endif
# endif # endif