]> xenbits.xensource.com Git - unikraft/libs/boost.git/commitdiff
Add fenv.h header
authorVlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@stud.acs.upb.ro>
Wed, 18 Dec 2019 16:11:41 +0000 (16:11 +0000)
committerFelipe Huici <felipe.huici@neclab.eu>
Wed, 8 Jan 2020 14:44:04 +0000 (15:44 +0100)
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
include/fenv.h [new file with mode: 0644]

diff --git a/include/fenv.h b/include/fenv.h
new file mode 100644 (file)
index 0000000..207bf84
--- /dev/null
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: MIT */                                                                                                                                                                                 
+/* ----------------------------------------------------------------------
+ * Copyright <C2><A9> 2005-2014 Rich Felker, et al.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * ----------------------------------------------------------------------
+ */
+/* Taken from musl-1.1.19 */
+
+#define FE_INVALID    1
+#define __FE_DENORM   2
+#define FE_DIVBYZERO  4
+#define FE_OVERFLOW   8
+#define FE_UNDERFLOW  16
+#define FE_INEXACT    32
+
+//#define FE_ALL_EXCEPT 63
+
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x400
+#define FE_UPWARD     0x800
+#define FE_TOWARDZERO 0xc00
+
+typedef unsigned short fexcept_t;
+
+typedef struct {
+       unsigned short __control_word;
+       unsigned short __unused1;
+       unsigned short __status_word;
+       unsigned short __unused2;
+       unsigned short __tags;
+       unsigned short __unused3;
+       unsigned int __eip;
+       unsigned short __cs_selector;
+       unsigned int __opcode:11;
+       unsigned int __unused4:5;
+       unsigned int __data_offset;
+       unsigned short __data_selector;
+       unsigned short __unused5;
+       unsigned int __mxcsr;
+} fenv_t;
+
+#define FE_DFL_ENV      ((const fenv_t *) -1)