Files
linux/include/asm-generic/simd.h
Herbert Xu 7ba8df4781 asm-generic: Make simd.h more resilient
Add missing header inclusions and protect against double inclusion.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-04-16 15:36:23 +08:00

22 lines
590 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_SIMD_H
#define _ASM_GENERIC_SIMD_H
#include <linux/compiler_attributes.h>
#include <linux/preempt.h>
#include <linux/types.h>
/*
* may_use_simd - whether it is allowable at this time to issue SIMD
* instructions or access the SIMD register file
*
* As architectures typically don't preserve the SIMD register file when
* taking an interrupt, !in_interrupt() should be a reasonable default.
*/
static __must_check inline bool may_use_simd(void)
{
return !in_interrupt();
}
#endif /* _ASM_GENERIC_SIMD_H */