diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-08-03 14:49:17 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-03 14:49:17 -0400 |
commit | f148af2593ef76ac705d1cc6abe48f455c9912cc (patch) | |
tree | cd1e0b0959624234ca3489df8888434ffea5050e /arch/arm/nwfpe/double_cpdo.c | |
parent | 1fcf844861eb08ee05e05dba13b5436f2f2e29ed (diff) |
[PATCH] ARM: 2837/2: Re: ARM: Make NWFPE preempt safe
Patch from Richard Purdie
NWFPE used global variables which meant it wasn't safe for use with
preemptive kernels. This patch removes them and communicates the
information between functions in a preempt safe manner. Generation
of some exceptions was broken and this has also been corrected.
Tests with glibc's maths test suite show no change in the results
before/after this patch.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/nwfpe/double_cpdo.c')
-rw-r--r-- | arch/arm/nwfpe/double_cpdo.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c index 7ffd8cb9bc96..c51d1386a97c 100644 --- a/arch/arm/nwfpe/double_cpdo.c +++ b/arch/arm/nwfpe/double_cpdo.c | |||
@@ -40,17 +40,17 @@ float64 float64_arccos(float64 rFm); | |||
40 | float64 float64_pow(float64 rFn, float64 rFm); | 40 | float64 float64_pow(float64 rFn, float64 rFm); |
41 | float64 float64_pol(float64 rFn, float64 rFm); | 41 | float64 float64_pol(float64 rFn, float64 rFm); |
42 | 42 | ||
43 | static float64 float64_rsf(float64 rFn, float64 rFm) | 43 | static float64 float64_rsf(struct roundingData *roundData, float64 rFn, float64 rFm) |
44 | { | 44 | { |
45 | return float64_sub(rFm, rFn); | 45 | return float64_sub(roundData, rFm, rFn); |
46 | } | 46 | } |
47 | 47 | ||
48 | static float64 float64_rdv(float64 rFn, float64 rFm) | 48 | static float64 float64_rdv(struct roundingData *roundData, float64 rFn, float64 rFm) |
49 | { | 49 | { |
50 | return float64_div(rFm, rFn); | 50 | return float64_div(roundData, rFm, rFn); |
51 | } | 51 | } |
52 | 52 | ||
53 | static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { | 53 | static float64 (*const dyadic_double[16])(struct roundingData*, float64 rFn, float64 rFm) = { |
54 | [ADF_CODE >> 20] = float64_add, | 54 | [ADF_CODE >> 20] = float64_add, |
55 | [MUF_CODE >> 20] = float64_mul, | 55 | [MUF_CODE >> 20] = float64_mul, |
56 | [SUF_CODE >> 20] = float64_sub, | 56 | [SUF_CODE >> 20] = float64_sub, |
@@ -65,12 +65,12 @@ static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { | |||
65 | [FRD_CODE >> 20] = float64_rdv, | 65 | [FRD_CODE >> 20] = float64_rdv, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static float64 float64_mvf(float64 rFm) | 68 | static float64 float64_mvf(struct roundingData *roundData,float64 rFm) |
69 | { | 69 | { |
70 | return rFm; | 70 | return rFm; |
71 | } | 71 | } |
72 | 72 | ||
73 | static float64 float64_mnf(float64 rFm) | 73 | static float64 float64_mnf(struct roundingData *roundData,float64 rFm) |
74 | { | 74 | { |
75 | union float64_components u; | 75 | union float64_components u; |
76 | 76 | ||
@@ -84,7 +84,7 @@ static float64 float64_mnf(float64 rFm) | |||
84 | return u.f64; | 84 | return u.f64; |
85 | } | 85 | } |
86 | 86 | ||
87 | static float64 float64_abs(float64 rFm) | 87 | static float64 float64_abs(struct roundingData *roundData,float64 rFm) |
88 | { | 88 | { |
89 | union float64_components u; | 89 | union float64_components u; |
90 | 90 | ||
@@ -98,7 +98,7 @@ static float64 float64_abs(float64 rFm) | |||
98 | return u.f64; | 98 | return u.f64; |
99 | } | 99 | } |
100 | 100 | ||
101 | static float64 (*const monadic_double[16])(float64 rFm) = { | 101 | static float64 (*const monadic_double[16])(struct roundingData *, float64 rFm) = { |
102 | [MVF_CODE >> 20] = float64_mvf, | 102 | [MVF_CODE >> 20] = float64_mvf, |
103 | [MNF_CODE >> 20] = float64_mnf, | 103 | [MNF_CODE >> 20] = float64_mnf, |
104 | [ABS_CODE >> 20] = float64_abs, | 104 | [ABS_CODE >> 20] = float64_abs, |
@@ -108,7 +108,7 @@ static float64 (*const monadic_double[16])(float64 rFm) = { | |||
108 | [NRM_CODE >> 20] = float64_mvf, | 108 | [NRM_CODE >> 20] = float64_mvf, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) | 111 | unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd) |
112 | { | 112 | { |
113 | FPA11 *fpa11 = GET_FPA11(); | 113 | FPA11 *fpa11 = GET_FPA11(); |
114 | float64 rFm; | 114 | float64 rFm; |
@@ -151,13 +151,13 @@ unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | if (dyadic_double[opc_mask_shift]) { | 153 | if (dyadic_double[opc_mask_shift]) { |
154 | rFd->fDouble = dyadic_double[opc_mask_shift](rFn, rFm); | 154 | rFd->fDouble = dyadic_double[opc_mask_shift](roundData, rFn, rFm); |
155 | } else { | 155 | } else { |
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | } else { | 158 | } else { |
159 | if (monadic_double[opc_mask_shift]) { | 159 | if (monadic_double[opc_mask_shift]) { |
160 | rFd->fDouble = monadic_double[opc_mask_shift](rFm); | 160 | rFd->fDouble = monadic_double[opc_mask_shift](roundData, rFm); |
161 | } else { | 161 | } else { |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |