summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_fp.h
blob: 81998215021ba9f4946e13c8e10a995b1ecba25b (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
28
29
30
31
32
33
34
35
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2026 RISCstar Solutions.
 *
 * Authors:
 *   Dave Patel <[email protected]>
 */
#ifndef __SBI_FP_H__
#define __SBI_FP_H__

#include <sbi/sbi_types.h>

struct sbi_fp_context {
#if __riscv_d
	uint64_t f[32];
#else
	uint32_t f[32];
#endif
	unsigned long fcsr;
};

#if defined(__riscv_f) || defined(__riscv_d)
void sbi_fp_save(struct sbi_fp_context *dst);
void sbi_fp_restore(const struct sbi_fp_context *src);
#else
static inline void sbi_fp_save(struct sbi_fp_context *dst)
{
}
static inline void sbi_fp_restore(const struct sbi_fp_context *src)
{
}
#endif /* __riscv_f || __riscv_d */

#endif /*__SBI_FP_H__ */