Print this page
5261 libm should stop using synonyms.h
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/common/m9x/fenv.c
+++ new/usr/src/lib/libm/common/m9x/fenv.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 */
21 21
22 22 /*
23 23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 25 /*
26 26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 28 */
29 29
30 -#pragma weak fex_merge_flags = __fex_merge_flags
30 +#pragma weak __fex_merge_flags = fex_merge_flags
31 31
32 -#pragma weak feholdexcept = __feholdexcept
33 -#pragma weak feupdateenv = __feupdateenv
34 -#pragma weak fegetenv = __fegetenv
35 -#pragma weak fesetenv = __fesetenv
36 -
37 -#pragma weak feholdexcept96 = __feholdexcept96
38 -#pragma weak feupdateenv96 = __feupdateenv
39 -#pragma weak fegetenv96 = __fegetenv
40 -#pragma weak fesetenv96 = __fesetenv
32 +#pragma weak __feholdexcept = feholdexcept
33 +#pragma weak __feupdateenv = feupdateenv
34 +#pragma weak __fegetenv = fegetenv
35 +#pragma weak __fesetenv = fesetenv
36 +
37 +#pragma weak feupdateenv96 = feupdateenv
38 +#pragma weak fegetenv96 = fegetenv
39 +#pragma weak fesetenv96 = fesetenv
41 40
42 -#include "fenv_synonyms.h"
43 41 #include <fenv.h>
44 42 #include <ucontext.h>
45 43 #include <thread.h>
46 44 #include "fex_handler.h"
47 45 #include "fenv_inlines.h"
48 46
49 47 const fenv_t __fenv_dfl_env = {
50 48 {
51 49 { FEX_NONSTOP, (void(*)())0 },
52 50 { FEX_NONSTOP, (void(*)())0 },
53 51 { FEX_NONSTOP, (void(*)())0 },
54 52 { FEX_NONSTOP, (void(*)())0 },
55 53 { FEX_NONSTOP, (void(*)())0 },
56 54 { FEX_NONSTOP, (void(*)())0 },
57 55 { FEX_NONSTOP, (void(*)())0 },
58 56 { FEX_NONSTOP, (void(*)())0 },
59 57 { FEX_NONSTOP, (void(*)())0 },
60 58 { FEX_NONSTOP, (void(*)())0 },
61 59 { FEX_NONSTOP, (void(*)())0 },
62 60 { FEX_NONSTOP, (void(*)())0 },
63 61 },
64 62 #ifdef __x86
65 63 0x13000000
66 64 #else
67 65 0
68 66 #endif
69 67 };
70 68
71 69 int feholdexcept(fenv_t *p)
72 70 {
73 71 (void) fegetenv(p);
74 72 (void) feclearexcept(FE_ALL_EXCEPT);
75 73 return !fex_set_handling(FEX_ALL, FEX_NONSTOP, NULL);
76 74 }
77 75
78 76 int feholdexcept96(fenv_t *p)
79 77 {
80 78 (void) fegetenv(p);
81 79 (void) feclearexcept(FE_ALL_EXCEPT);
82 80 return fex_set_handling(FEX_ALL, FEX_NONSTOP, NULL);
83 81 }
84 82
85 83 int feupdateenv(const fenv_t *p)
86 84 {
87 85 unsigned long fsr;
88 86
89 87 __fenv_getfsr(&fsr);
90 88 (void) fesetenv(p);
91 89 (void) feraiseexcept((int)__fenv_get_ex(fsr));
92 90 return 0;
93 91 }
94 92
95 93 int fegetenv(fenv_t *p)
96 94 {
97 95 fex_getexcepthandler(&p->__handlers, FEX_ALL);
98 96 __fenv_getfsr(&p->__fsr);
99 97 return 0;
100 98 }
101 99
102 100 int fesetenv(const fenv_t *p)
103 101 {
104 102 __fenv_setfsr(&p->__fsr);
105 103 fex_setexcepthandler(&p->__handlers, FEX_ALL);
106 104 return 0;
107 105 }
108 106
109 107 void fex_merge_flags(const fenv_t *p)
110 108 {
111 109 unsigned long fsr;
112 110
113 111 __fenv_getfsr(&fsr);
114 112 __fenv_set_ex(fsr, __fenv_get_ex(fsr) | __fenv_get_ex(p->__fsr));
115 113 __fenv_setfsr(&fsr);
116 114 if (fex_get_log())
117 115 __fex_update_te();
118 116 }
↓ open down ↓ |
66 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX