diff options
author | Shengqi Chen <[email protected]> | 2023-11-22 21:58:47 +0800 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2024-08-26 15:10:16 -0700 |
commit | bce36e21cac2d9d59b7a9d18e8d219ea73623ec8 (patch) | |
tree | 8728f44caecb3528b82ead350c777fa276af944c | |
parent | 86492e3c96550209faccb2ba0ab496725c326dba (diff) |
module/icp/asm-arm/sha2: auto detect __ARM_ARCH
This patch uses __ARM_ARCH set by compiler (both
GCC and Clang have this) whenever possible instead
of hardcoding it to 7. This change allows code to
compile on earlier ARM architectures such as armv5te.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes #15557
-rw-r--r-- | module/icp/asm-arm/sha2/sha256-armv7.S | 7 | ||||
-rw-r--r-- | module/icp/asm-arm/sha2/sha512-armv7.S | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/module/icp/asm-arm/sha2/sha256-armv7.S b/module/icp/asm-arm/sha2/sha256-armv7.S index 0001e4d69..0d3631587 100644 --- a/module/icp/asm-arm/sha2/sha256-armv7.S +++ b/module/icp/asm-arm/sha2/sha256-armv7.S @@ -21,8 +21,11 @@ #if defined(__arm__) -#define __ARM_ARCH__ 7 -#define __ARM_MAX_ARCH__ 7 +#ifndef __ARM_ARCH +# define __ARM_ARCH__ 7 +#else +# define __ARM_ARCH__ __ARM_ARCH +#endif #if defined(__thumb2__) .syntax unified diff --git a/module/icp/asm-arm/sha2/sha512-armv7.S b/module/icp/asm-arm/sha2/sha512-armv7.S index a4c804033..499cb6df9 100644 --- a/module/icp/asm-arm/sha2/sha512-armv7.S +++ b/module/icp/asm-arm/sha2/sha512-armv7.S @@ -21,8 +21,11 @@ #if defined(__arm__) -#define __ARM_ARCH__ 7 -#define __ARM_MAX_ARCH__ 7 +#ifndef __ARM_ARCH +# define __ARM_ARCH__ 7 +#else +# define __ARM_ARCH__ __ARM_ARCH +#endif #ifndef __KERNEL__ # define VFP_ABI_PUSH vstmdb sp!,{d8-d15} |