diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h index 5249600..26ac440 100644 --- a/include/lib/utils_def.h +++ b/include/lib/utils_def.h @@ -73,4 +73,12 @@ # define ULL(_x) (_x##ull) #endif +/* + * Test for the current architecture version to be at least the version + * expected. + */ +#define ARM_ARCH_AT_LEAST(_maj, _min) \ + ((ARM_ARCH_MAJOR > _maj) || \ + ((ARM_ARCH_MAJOR == _maj) && (ARM_ARCH_MINOR >= _min))) + #endif /* __UTILS_DEF_H__ */ diff --git a/lib/locks/exclusive/aarch64/spinlock.S b/lib/locks/exclusive/aarch64/spinlock.S index 59305d8..e2f9eaa 100644 --- a/lib/locks/exclusive/aarch64/spinlock.S +++ b/lib/locks/exclusive/aarch64/spinlock.S @@ -9,7 +9,7 @@ .globl spin_lock .globl spin_unlock -#if (ARM_ARCH_MAJOR > 8) || ((ARM_ARCH_MAJOR == 8) && (ARM_ARCH_MINOR >= 1)) +#if ARM_ARCH_AT_LEAST(8, 1) /* * When compiled for ARMv8.1 or later, choose spin locks based on Compare and