diff options
| author | Brent Cook <bcook@openbsd.org> | 2016-07-17 18:12:23 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2016-07-17 18:12:23 -0500 |
| commit | a9332ccecfce63bf54924e70c11f420edd3ae312 (patch) | |
| tree | efd91a22aa10d5a355487316c69eab11763df28f | |
| parent | fa435db8df9fca0220a69343ffed0aa6d1172097 (diff) | |
| download | portable-a9332ccecfce63bf54924e70c11f420edd3ae312.tar.gz portable-a9332ccecfce63bf54924e70c11f420edd3ae312.tar.bz2 portable-a9332ccecfce63bf54924e70c11f420edd3ae312.zip | |
avoid BSWAP assembly for ARM <= v6
| -rw-r--r-- | patches/modes_lcl.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/patches/modes_lcl.h b/patches/modes_lcl.h new file mode 100644 index 0000000..1ba9f2e --- /dev/null +++ b/patches/modes_lcl.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | --- openbsd/src/lib/libssl/src/crypto/modes/modes_lcl.h Sat Dec 6 17:15:50 2014 | ||
| 2 | +++ crypto/modes/modes_lcl.h Sun Jul 17 17:45:27 2016 | ||
| 3 | @@ -43,14 +43,16 @@ | ||
| 4 | asm ("bswapl %0" \ | ||
| 5 | : "+r"(ret)); ret; }) | ||
| 6 | # elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT) | ||
| 7 | -# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | ||
| 8 | +# if (__ARM_ARCH >= 6) | ||
| 9 | +# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | ||
| 10 | asm ("rev %0,%0; rev %1,%1" \ | ||
| 11 | : "+r"(hi),"+r"(lo)); \ | ||
| 12 | (u64)hi<<32|lo; }) | ||
| 13 | -# define BSWAP4(x) ({ u32 ret; \ | ||
| 14 | +# define BSWAP4(x) ({ u32 ret; \ | ||
| 15 | asm ("rev %0,%1" \ | ||
| 16 | : "=r"(ret) : "r"((u32)(x))); \ | ||
| 17 | ret; }) | ||
| 18 | +# endif | ||
| 19 | # endif | ||
| 20 | #endif | ||
| 21 | #endif | ||
