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