Xenomai  3.0.8
fptest.h
1 /*
2  * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 #ifndef _COBALT_POWERPC_ASM_FPTEST_H
20 #define _COBALT_POWERPC_ASM_FPTEST_H
21 
22 #include <linux/errno.h>
23 #include <linux/printk.h>
24 #include <asm/xenomai/uapi/fptest.h>
25 
26 static inline int fp_kernel_supported(void)
27 {
28 /*
29  * CAUTION: some architectures have a hardware FP unit, but a
30  * restricted set of supported FP instructions. Those may enable
31  * CONFIG_MATH_EMULATION and MATH_EMULATION_HW_UNIMPLEMENTED at the
32  * same time to provide an emulation of the missing instruction set.
33  */
34 #ifdef CONFIG_PPC_FPU
35  return 1;
36 #else
37 #ifdef CONFIG_MATH_EMULATION
38  printk_once(XENO_WARNING "kernel-based FPU support is disabled\n");
39 #endif /* !CONFIG_MATH_EMULATION */
40  return 0;
41 #endif /* !CONFIG_PPC_FPU */
42 }
43 
44 static inline int fp_linux_begin(void)
45 {
46  return -ENOSYS;
47 }
48 
49 static inline void fp_linux_end(void)
50 {
51 }
52 
53 static inline int fp_detect(void)
54 {
55  return 0;
56 }
57 
58 #endif /* !_COBALT_POWERPC_ASM_FPTEST_H */