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 <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #15557
This commit is contained in:
Shengqi Chen 2023-11-22 21:58:47 +08:00 committed by Tony Hutter
parent 86492e3c96
commit bce36e21ca
2 changed files with 10 additions and 4 deletions

View File

@ -21,8 +21,11 @@
#if defined(__arm__) #if defined(__arm__)
#define __ARM_ARCH__ 7 #ifndef __ARM_ARCH
#define __ARM_MAX_ARCH__ 7 # define __ARM_ARCH__ 7
#else
# define __ARM_ARCH__ __ARM_ARCH
#endif
#if defined(__thumb2__) #if defined(__thumb2__)
.syntax unified .syntax unified

View File

@ -21,8 +21,11 @@
#if defined(__arm__) #if defined(__arm__)
#define __ARM_ARCH__ 7 #ifndef __ARM_ARCH
#define __ARM_MAX_ARCH__ 7 # define __ARM_ARCH__ 7
#else
# define __ARM_ARCH__ __ARM_ARCH
#endif
#ifndef __KERNEL__ #ifndef __KERNEL__
# define VFP_ABI_PUSH vstmdb sp!,{d8-d15} # define VFP_ABI_PUSH vstmdb sp!,{d8-d15}