summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/fpu.h
blob: bdc4c6304c6a7c591f483ecdca5699aa1b1ed8b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2023 SiFive
 */

#ifndef __ASM_FPU_H
#define __ASM_FPU_H

#include <linux/preempt.h>
#include <asm/neon.h>

#define kernel_fpu_available()	cpu_has_neon()

static inline void kernel_fpu_begin(void)
{
	BUG_ON(!in_task());
	preempt_disable();
	kernel_neon_begin();
}

static inline void kernel_fpu_end(void)
{
	kernel_neon_end();
	preempt_enable();
}

#endif /* ! __ASM_FPU_H */