320838263f1e86507d4a958edd93a3f4459edc82
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / arch / arm64 / include / asm / simd.h
1 /*
2 * Copyright (C) 2017 Linaro Ltd. <ard.biesheuvel@linaro.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
7 */
8
9 #ifndef __ASM_SIMD_H
10 #define __ASM_SIMD_H
11
12 #include <linux/types.h>
13
14 /*
15 * may_use_simd - whether it is allowable at this time to issue SIMD
16 * instructions or access the SIMD register file
17 */
18 static __must_check inline bool may_use_simd(void)
19 {
20 <<<<<<< HEAD
21 return true;
22 =======
23 /*
24 * kernel_neon_busy is only set while preemption is disabled,
25 * and is clear whenever preemption is enabled. Since
26 * this_cpu_read() is atomic w.r.t. preemption, kernel_neon_busy
27 * cannot change under our feet -- if it's set we cannot be
28 * migrated, and if it's clear we cannot be migrated to a CPU
29 * where it is set.
30 */
31 return !in_irq() && !irqs_disabled() && !in_nmi() &&
32 !this_cpu_read(kernel_neon_busy);
33 >>>>>>> 818299f6bdae
34 }
35
36 #endif