162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci#include <linux/hardirq.h> 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci/* 662306a36Sopenharmony_ci * may_use_simd - whether it is allowable at this time to issue SIMD 762306a36Sopenharmony_ci * instructions or access the SIMD register file 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * As architectures typically don't preserve the SIMD register file when 1062306a36Sopenharmony_ci * taking an interrupt, !in_interrupt() should be a reasonable default. 1162306a36Sopenharmony_ci */ 1262306a36Sopenharmony_cistatic __must_check inline bool may_use_simd(void) 1362306a36Sopenharmony_ci{ 1462306a36Sopenharmony_ci return !in_interrupt(); 1562306a36Sopenharmony_ci} 16