diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2005-11-07 16:12:08 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-07 16:12:08 -0500 |
commit | bedf142b8bba4331ed93161292a4ce4f8cde7308 (patch) | |
tree | cde053618935762e37badb509d191ac006ae197a | |
parent | 06c03cac9487555478c7d80065ebf7818bf6fd06 (diff) |
[ARM] 3118/1: fix and reenable nwfpe extended precision emulation for big-endian
Patch from Lennert Buytenhek
nwfpe extended precision emulation used to be broken on big-endian
and was therefore disabled. This patch fixes nwfpe so that it copies
extended precision floats to/from userspace in the proper word order
(similar to patch #2046, see the description of that patch for an
explanation) and reenables the Kconfig option.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpa11.h | 2 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpa11_cpdt.c | 10 | ||||
-rw-r--r-- | arch/arm/nwfpe/softfloat.h | 15 |
4 files changed, 22 insertions, 7 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 296bc03d1cf1..056adc8a7d34 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -585,7 +585,7 @@ config FPE_NWFPE | |||
585 | 585 | ||
586 | config FPE_NWFPE_XP | 586 | config FPE_NWFPE_XP |
587 | bool "Support extended precision" | 587 | bool "Support extended precision" |
588 | depends on FPE_NWFPE && !CPU_BIG_ENDIAN | 588 | depends on FPE_NWFPE |
589 | help | 589 | help |
590 | Say Y to include 80-bit support in the kernel floating-point | 590 | Say Y to include 80-bit support in the kernel floating-point |
591 | emulator. Otherwise, only 32 and 64-bit support is compiled in. | 591 | emulator. Otherwise, only 32 and 64-bit support is compiled in. |
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h index 9677ae8448e8..da4c616b6c49 100644 --- a/arch/arm/nwfpe/fpa11.h +++ b/arch/arm/nwfpe/fpa11.h | |||
@@ -60,7 +60,7 @@ typedef union tagFPREG { | |||
60 | #ifdef CONFIG_FPE_NWFPE_XP | 60 | #ifdef CONFIG_FPE_NWFPE_XP |
61 | floatx80 fExtended; | 61 | floatx80 fExtended; |
62 | #else | 62 | #else |
63 | int padding[3]; | 63 | u32 padding[3]; |
64 | #endif | 64 | #endif |
65 | } FPREG; | 65 | } FPREG; |
66 | 66 | ||
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c index b0db5cbcc3b1..32859fa8dcfc 100644 --- a/arch/arm/nwfpe/fpa11_cpdt.c +++ b/arch/arm/nwfpe/fpa11_cpdt.c | |||
@@ -59,8 +59,13 @@ static inline void loadExtended(const unsigned int Fn, const unsigned int __user | |||
59 | p = (unsigned int *) &fpa11->fpreg[Fn].fExtended; | 59 | p = (unsigned int *) &fpa11->fpreg[Fn].fExtended; |
60 | fpa11->fType[Fn] = typeExtended; | 60 | fpa11->fType[Fn] = typeExtended; |
61 | get_user(p[0], &pMem[0]); /* sign & exponent */ | 61 | get_user(p[0], &pMem[0]); /* sign & exponent */ |
62 | #ifdef __ARMEB__ | ||
63 | get_user(p[1], &pMem[1]); /* ms bits */ | ||
64 | get_user(p[2], &pMem[2]); /* ls bits */ | ||
65 | #else | ||
62 | get_user(p[1], &pMem[2]); /* ls bits */ | 66 | get_user(p[1], &pMem[2]); /* ls bits */ |
63 | get_user(p[2], &pMem[1]); /* ms bits */ | 67 | get_user(p[2], &pMem[1]); /* ms bits */ |
68 | #endif | ||
64 | } | 69 | } |
65 | #endif | 70 | #endif |
66 | 71 | ||
@@ -177,8 +182,13 @@ static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMe | |||
177 | } | 182 | } |
178 | 183 | ||
179 | put_user(val.i[0], &pMem[0]); /* sign & exp */ | 184 | put_user(val.i[0], &pMem[0]); /* sign & exp */ |
185 | #ifdef __ARMEB__ | ||
186 | put_user(val.i[1], &pMem[1]); /* msw */ | ||
187 | put_user(val.i[2], &pMem[2]); | ||
188 | #else | ||
180 | put_user(val.i[1], &pMem[2]); | 189 | put_user(val.i[1], &pMem[2]); |
181 | put_user(val.i[2], &pMem[1]); /* msw */ | 190 | put_user(val.i[2], &pMem[1]); /* msw */ |
191 | #endif | ||
182 | } | 192 | } |
183 | #endif | 193 | #endif |
184 | 194 | ||
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h index 1301d97e037f..978c699673c6 100644 --- a/arch/arm/nwfpe/softfloat.h +++ b/arch/arm/nwfpe/softfloat.h | |||
@@ -51,12 +51,17 @@ input or output the `floatx80' type will be defined. | |||
51 | Software IEC/IEEE floating-point types. | 51 | Software IEC/IEEE floating-point types. |
52 | ------------------------------------------------------------------------------- | 52 | ------------------------------------------------------------------------------- |
53 | */ | 53 | */ |
54 | typedef unsigned long int float32; | 54 | typedef u32 float32; |
55 | typedef unsigned long long float64; | 55 | typedef u64 float64; |
56 | typedef struct { | 56 | typedef struct { |
57 | unsigned short high; | 57 | #ifdef __ARMEB__ |
58 | unsigned short __padding; | 58 | u16 __padding; |
59 | unsigned long long low; | 59 | u16 high; |
60 | #else | ||
61 | u16 high; | ||
62 | u16 __padding; | ||
63 | #endif | ||
64 | u64 low; | ||
60 | } floatx80; | 65 | } floatx80; |
61 | 66 | ||
62 | /* | 67 | /* |