relay on HWCAP_SB definition

This commit is contained in:
Salvatore Dipietro 2025-05-09 17:05:38 -07:00
parent 5304ab5460
commit d1bb7c6ba7
2 changed files with 2 additions and 5 deletions

View file

@ -11,6 +11,7 @@ void detect_arm_sb_support(void);
/* Use SB instruction if available, otherwise ISB */
static inline void
spin_delay_arm(void) {
#ifdef HWCAP_SB
if (__builtin_expect(arm_has_sb_instruction == 1, 1)) {
/* SB instruction encoding */
asm volatile(".inst 0xd50330ff \n");
@ -18,4 +19,5 @@ spin_delay_arm(void) {
/* ISB instruction */
asm volatile("isb; \n");
}
#endif // HWCAP_SB
}

View file

@ -4,11 +4,6 @@
#if defined(__linux__) && (defined(__aarch64__) || defined(__arm64__))
#include <sys/auxv.h>
/* Define HWCAP_SB if not already defined in system headers */
#ifndef HWCAP_SB
#define HWCAP_SB (1ULL << 56) /* Speculation Barrier */
#endif // HWCAP_SB
#endif // __linux__ && (defined(__aarch64__) || defined(__arm64__))
/* Global variable to track SB support, defined here to avoid multiple definitions */