diff options
Diffstat (limited to 'arch/mips/math-emu/kernel_linkage.c')
-rw-r--r-- | arch/mips/math-emu/kernel_linkage.c | 76 |
1 files changed, 2 insertions, 74 deletions
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c index 3aeae07ed5b8..eb58a85b3157 100644 --- a/arch/mips/math-emu/kernel_linkage.c +++ b/arch/mips/math-emu/kernel_linkage.c | |||
@@ -40,78 +40,6 @@ void fpu_emulator_init_fpu(void) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | current->thread.fpu.fcr31 = 0; | 42 | current->thread.fpu.fcr31 = 0; |
43 | for (i = 0; i < 32; i++) { | 43 | for (i = 0; i < 32; i++) |
44 | current->thread.fpu.fpr[i] = SIGNALLING_NAN; | 44 | set_fpr64(¤t->thread.fpu.fpr[i], 0, SIGNALLING_NAN); |
45 | } | ||
46 | } | ||
47 | |||
48 | |||
49 | /* | ||
50 | * Emulator context save/restore to/from a signal context | ||
51 | * presumed to be on the user stack, and therefore accessed | ||
52 | * with appropriate macros from uaccess.h | ||
53 | */ | ||
54 | |||
55 | int fpu_emulator_save_context(struct sigcontext __user *sc) | ||
56 | { | ||
57 | int i; | ||
58 | int err = 0; | ||
59 | |||
60 | for (i = 0; i < 32; i++) { | ||
61 | err |= | ||
62 | __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); | ||
63 | } | ||
64 | err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); | ||
65 | |||
66 | return err; | ||
67 | } | ||
68 | |||
69 | int fpu_emulator_restore_context(struct sigcontext __user *sc) | ||
70 | { | ||
71 | int i; | ||
72 | int err = 0; | ||
73 | |||
74 | for (i = 0; i < 32; i++) { | ||
75 | err |= | ||
76 | __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); | ||
77 | } | ||
78 | err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); | ||
79 | |||
80 | return err; | ||
81 | } | ||
82 | |||
83 | #ifdef CONFIG_64BIT | ||
84 | /* | ||
85 | * This is the o32 version | ||
86 | */ | ||
87 | |||
88 | int fpu_emulator_save_context32(struct sigcontext32 __user *sc) | ||
89 | { | ||
90 | int i; | ||
91 | int err = 0; | ||
92 | int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1; | ||
93 | |||
94 | for (i = 0; i < 32; i += inc) { | ||
95 | err |= | ||
96 | __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); | ||
97 | } | ||
98 | err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); | ||
99 | |||
100 | return err; | ||
101 | } | ||
102 | |||
103 | int fpu_emulator_restore_context32(struct sigcontext32 __user *sc) | ||
104 | { | ||
105 | int i; | ||
106 | int err = 0; | ||
107 | int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1; | ||
108 | |||
109 | for (i = 0; i < 32; i += inc) { | ||
110 | err |= | ||
111 | __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); | ||
112 | } | ||
113 | err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); | ||
114 | |||
115 | return err; | ||
116 | } | 45 | } |
117 | #endif | ||