]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libm/sh/feholdexcpt.c
Inital import
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libm / sh / feholdexcpt.c
1 /*
2  *
3  * Copyright (c) 2007  STMicroelectronics Ltd
4  * Filippo Arcidiacono (filippo.arcidiacono@st.com)
5  *
6  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7  *
8  * Taken from glibc 2.6
9  *
10  */
11
12 #include <fenv.h>
13 #include <fpu_control.h>
14
15 int
16 feholdexcept (fenv_t *envp)
17 {
18   unsigned long int temp;
19
20   /* Store the environment.  */
21   _FPU_GETCW (temp);
22   envp->__fpscr = temp;
23
24   /* Now set all exceptions to non-stop.  */
25   temp &= ~FE_ALL_EXCEPT;
26   _FPU_SETCW (temp);
27
28   return 1;
29 }