Merge tag 'mm-nonmm-stable-2024-05-22-17-30' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / arch / powerpc / include / asm / fpu.h
CommitLineData
01db473e
SH
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2023 SiFive
4 */
5
6#ifndef _ASM_POWERPC_FPU_H
7#define _ASM_POWERPC_FPU_H
8
9#include <linux/preempt.h>
10
11#include <asm/cpu_has_feature.h>
12#include <asm/switch_to.h>
13
14#define kernel_fpu_available() (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE))
15
16static inline void kernel_fpu_begin(void)
17{
18 preempt_disable();
19 enable_kernel_fp();
20}
21
22static inline void kernel_fpu_end(void)
23{
24 disable_kernel_fp();
25 preempt_enable();
26}
27
28#endif /* ! _ASM_POWERPC_FPU_H */