]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/math-emu/stfs.c
powerpc/math-emu: Use kernel generic math-emu code
[linux-2.6-omap-h63xx.git] / arch / powerpc / math-emu / stfs.c
index 8689aa48ef6952b8d45d9e3218d8bd97f7f8f71d..6122147356d1b2fa008922ae86e0fb157ce557f7 100644 (file)
@@ -2,23 +2,24 @@
 #include <linux/errno.h>
 #include <asm/uaccess.h>
 
-#include "soft-fp.h"
-#include "double.h"
-#include "single.h"
+#include <asm/sfp-machine.h>
+#include <math-emu/soft-fp.h>
+#include <math-emu/double.h>
+#include <math-emu/single.h>
 
 int
 stfs(void *frS, void *ea)
 {
        FP_DECL_D(A);
        FP_DECL_S(R);
+       FP_DECL_EX;
        float f;
-       int err;
 
 #ifdef DEBUG
        printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
-       __FP_UNPACK_D(A, frS);
+       FP_UNPACK_DP(A, frS);
 
 #ifdef DEBUG
        printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -30,12 +31,12 @@ stfs(void *frS, void *ea)
        printk("R: %ld %lu %ld (%ld)\n", R_s, R_f, R_e, R_c);
 #endif
 
-       err = _FP_PACK_CANONICAL(S, 1, R);
-       if (!err || !__FPU_TRAP_P(err)) {
-               __FP_PACK_RAW_1(S, &f, R);
+       _FP_PACK_CANONICAL(S, 1, R);
+       if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {
+               _FP_PACK_RAW_1_P(S, &f, R);
                if (copy_to_user(ea, &f, sizeof(float)))
                        return -EFAULT;
        }
 
-       return err;
+       return FP_CUR_EXCEPTIONS;
 }