forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/x86/math-emu/fpu_entry.c
....@@ -113,9 +113,6 @@
113113 unsigned long code_base = 0;
114114 unsigned long code_limit = 0; /* Initialized to stop compiler warnings */
115115 struct desc_struct code_descriptor;
116
- struct fpu *fpu = &current->thread.fpu;
117
-
118
- fpu__initialize(fpu);
119116
120117 #ifdef RE_ENTRANT_CHECKING
121118 if (emulating) {
....@@ -692,12 +689,10 @@
692689
693690 int fpregs_soft_get(struct task_struct *target,
694691 const struct user_regset *regset,
695
- unsigned int pos, unsigned int count,
696
- void *kbuf, void __user *ubuf)
692
+ struct membuf to)
697693 {
698694 struct swregs_state *s387 = &target->thread.fpu.state.soft;
699695 const void *space = s387->st_space;
700
- int ret;
701696 int offset = (S387->ftop & 7) * 10, other = 80 - offset;
702697
703698 RE_ENTRANT_CHECK_OFF;
....@@ -712,18 +707,11 @@
712707 S387->fos |= 0xffff0000;
713708 #endif /* PECULIAR_486 */
714709
715
- ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, s387, 0,
716
- offsetof(struct swregs_state, st_space));
717
-
718
- /* Copy all registers in stack order. */
719
- if (!ret)
720
- ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
721
- space + offset, 0, other);
722
- if (!ret)
723
- ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
724
- space, 0, offset);
710
+ membuf_write(&to, s387, offsetof(struct swregs_state, st_space));
711
+ membuf_write(&to, space + offset, other);
712
+ membuf_write(&to, space, offset);
725713
726714 RE_ENTRANT_CHECK_ON;
727715
728
- return ret;
716
+ return 0;
729717 }