1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _ASM_GENERIC_SIMD_H 3 #define _ASM_GENERIC_SIMD_H 4 5 #include <linux/compiler_attributes.h> 6 #include <linux/preempt.h> 7 #include <linux/types.h> 8 9 /* 10 * may_use_simd - whether it is allowable at this time to issue SIMD 11 * instructions or access the SIMD register file 12 * 13 * As architectures typically don't preserve the SIMD register file when 14 * taking an interrupt, !in_interrupt() should be a reasonable default. 15 */ 16 static __must_check inline bool may_use_simd(void) 17 { 18 return !in_interrupt(); 19 } 20 21 #endif /* _ASM_GENERIC_SIMD_H */ 22