forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/x86/math-emu/reg_ld_str.c
....@@ -84,8 +84,8 @@
8484 FPU_REG *sti_ptr = &st(stnr);
8585
8686 RE_ENTRANT_CHECK_OFF;
87
- FPU_access_ok(VERIFY_READ, s, 10);
88
- __copy_from_user(sti_ptr, s, 10);
87
+ FPU_access_ok(s, 10);
88
+ FPU_copy_from_user(sti_ptr, s, 10);
8989 RE_ENTRANT_CHECK_ON;
9090
9191 return FPU_tagof(sti_ptr);
....@@ -98,7 +98,7 @@
9898 unsigned m64, l64;
9999
100100 RE_ENTRANT_CHECK_OFF;
101
- FPU_access_ok(VERIFY_READ, dfloat, 8);
101
+ FPU_access_ok(dfloat, 8);
102102 FPU_get_user(m64, 1 + (unsigned long __user *)dfloat);
103103 FPU_get_user(l64, (unsigned long __user *)dfloat);
104104 RE_ENTRANT_CHECK_ON;
....@@ -159,7 +159,7 @@
159159 int exp, tag, negative;
160160
161161 RE_ENTRANT_CHECK_OFF;
162
- FPU_access_ok(VERIFY_READ, single, 4);
162
+ FPU_access_ok(single, 4);
163163 FPU_get_user(m32, (unsigned long __user *)single);
164164 RE_ENTRANT_CHECK_ON;
165165
....@@ -214,7 +214,7 @@
214214 FPU_REG *st0_ptr = &st(0);
215215
216216 RE_ENTRANT_CHECK_OFF;
217
- FPU_access_ok(VERIFY_READ, _s, 8);
217
+ FPU_access_ok(_s, 8);
218218 if (copy_from_user(&s, _s, 8))
219219 FPU_abort;
220220 RE_ENTRANT_CHECK_ON;
....@@ -243,7 +243,7 @@
243243 int negative;
244244
245245 RE_ENTRANT_CHECK_OFF;
246
- FPU_access_ok(VERIFY_READ, _s, 4);
246
+ FPU_access_ok(_s, 4);
247247 FPU_get_user(s, _s);
248248 RE_ENTRANT_CHECK_ON;
249249
....@@ -271,7 +271,7 @@
271271 int s, negative;
272272
273273 RE_ENTRANT_CHECK_OFF;
274
- FPU_access_ok(VERIFY_READ, _s, 2);
274
+ FPU_access_ok(_s, 2);
275275 /* Cast as short to get the sign extended. */
276276 FPU_get_user(s, _s);
277277 RE_ENTRANT_CHECK_ON;
....@@ -304,7 +304,7 @@
304304 int sign;
305305
306306 RE_ENTRANT_CHECK_OFF;
307
- FPU_access_ok(VERIFY_READ, s, 10);
307
+ FPU_access_ok(s, 10);
308308 RE_ENTRANT_CHECK_ON;
309309 for (pos = 8; pos >= 0; pos--) {
310310 l *= 10;
....@@ -345,7 +345,7 @@
345345
346346 if (st0_tag != TAG_Empty) {
347347 RE_ENTRANT_CHECK_OFF;
348
- FPU_access_ok(VERIFY_WRITE, d, 10);
348
+ FPU_access_ok(d, 10);
349349
350350 FPU_put_user(st0_ptr->sigl, (unsigned long __user *)d);
351351 FPU_put_user(st0_ptr->sigh,
....@@ -364,7 +364,7 @@
364364 /* The masked response */
365365 /* Put out the QNaN indefinite */
366366 RE_ENTRANT_CHECK_OFF;
367
- FPU_access_ok(VERIFY_WRITE, d, 10);
367
+ FPU_access_ok(d, 10);
368368 FPU_put_user(0, (unsigned long __user *)d);
369369 FPU_put_user(0xc0000000, 1 + (unsigned long __user *)d);
370370 FPU_put_user(0xffff, 4 + (short __user *)d);
....@@ -539,7 +539,7 @@
539539 /* The masked response */
540540 /* Put out the QNaN indefinite */
541541 RE_ENTRANT_CHECK_OFF;
542
- FPU_access_ok(VERIFY_WRITE, dfloat, 8);
542
+ FPU_access_ok(dfloat, 8);
543543 FPU_put_user(0, (unsigned long __user *)dfloat);
544544 FPU_put_user(0xfff80000,
545545 1 + (unsigned long __user *)dfloat);
....@@ -552,7 +552,7 @@
552552 l[1] |= 0x80000000;
553553
554554 RE_ENTRANT_CHECK_OFF;
555
- FPU_access_ok(VERIFY_WRITE, dfloat, 8);
555
+ FPU_access_ok(dfloat, 8);
556556 FPU_put_user(l[0], (unsigned long __user *)dfloat);
557557 FPU_put_user(l[1], 1 + (unsigned long __user *)dfloat);
558558 RE_ENTRANT_CHECK_ON;
....@@ -724,7 +724,7 @@
724724 /* The masked response */
725725 /* Put out the QNaN indefinite */
726726 RE_ENTRANT_CHECK_OFF;
727
- FPU_access_ok(VERIFY_WRITE, single, 4);
727
+ FPU_access_ok(single, 4);
728728 FPU_put_user(0xffc00000,
729729 (unsigned long __user *)single);
730730 RE_ENTRANT_CHECK_ON;
....@@ -742,7 +742,7 @@
742742 templ |= 0x80000000;
743743
744744 RE_ENTRANT_CHECK_OFF;
745
- FPU_access_ok(VERIFY_WRITE, single, 4);
745
+ FPU_access_ok(single, 4);
746746 FPU_put_user(templ, (unsigned long __user *)single);
747747 RE_ENTRANT_CHECK_ON;
748748
....@@ -791,7 +791,7 @@
791791 }
792792
793793 RE_ENTRANT_CHECK_OFF;
794
- FPU_access_ok(VERIFY_WRITE, d, 8);
794
+ FPU_access_ok(d, 8);
795795 if (copy_to_user(d, &tll, 8))
796796 FPU_abort;
797797 RE_ENTRANT_CHECK_ON;
....@@ -838,7 +838,7 @@
838838 }
839839
840840 RE_ENTRANT_CHECK_OFF;
841
- FPU_access_ok(VERIFY_WRITE, d, 4);
841
+ FPU_access_ok(d, 4);
842842 FPU_put_user(t.sigl, (unsigned long __user *)d);
843843 RE_ENTRANT_CHECK_ON;
844844
....@@ -884,7 +884,7 @@
884884 }
885885
886886 RE_ENTRANT_CHECK_OFF;
887
- FPU_access_ok(VERIFY_WRITE, d, 2);
887
+ FPU_access_ok(d, 2);
888888 FPU_put_user((short)t.sigl, d);
889889 RE_ENTRANT_CHECK_ON;
890890
....@@ -925,7 +925,7 @@
925925 if (control_word & CW_Invalid) {
926926 /* Produce the QNaN "indefinite" */
927927 RE_ENTRANT_CHECK_OFF;
928
- FPU_access_ok(VERIFY_WRITE, d, 10);
928
+ FPU_access_ok(d, 10);
929929 for (i = 0; i < 7; i++)
930930 FPU_put_user(0, d + i); /* These bytes "undefined" */
931931 FPU_put_user(0xc0, d + 7); /* This byte "undefined" */
....@@ -941,7 +941,7 @@
941941 }
942942
943943 RE_ENTRANT_CHECK_OFF;
944
- FPU_access_ok(VERIFY_WRITE, d, 10);
944
+ FPU_access_ok(d, 10);
945945 RE_ENTRANT_CHECK_ON;
946946 for (i = 0; i < 9; i++) {
947947 b = FPU_div_small(&ll, 10);
....@@ -1034,7 +1034,7 @@
10341034 ((addr_modes.default_mode == PM16)
10351035 ^ (addr_modes.override.operand_size == OP_SIZE_PREFIX))) {
10361036 RE_ENTRANT_CHECK_OFF;
1037
- FPU_access_ok(VERIFY_READ, s, 0x0e);
1037
+ FPU_access_ok(s, 0x0e);
10381038 FPU_get_user(control_word, (unsigned short __user *)s);
10391039 FPU_get_user(partial_status, (unsigned short __user *)(s + 2));
10401040 FPU_get_user(tag_word, (unsigned short __user *)(s + 4));
....@@ -1056,7 +1056,7 @@
10561056 }
10571057 } else {
10581058 RE_ENTRANT_CHECK_OFF;
1059
- FPU_access_ok(VERIFY_READ, s, 0x1c);
1059
+ FPU_access_ok(s, 0x1c);
10601060 FPU_get_user(control_word, (unsigned short __user *)s);
10611061 FPU_get_user(partial_status, (unsigned short __user *)(s + 4));
10621062 FPU_get_user(tag_word, (unsigned short __user *)(s + 8));
....@@ -1125,10 +1125,10 @@
11251125
11261126 /* Copy all registers in stack order. */
11271127 RE_ENTRANT_CHECK_OFF;
1128
- FPU_access_ok(VERIFY_READ, s, 80);
1129
- __copy_from_user(register_base + offset, s, other);
1128
+ FPU_access_ok(s, 80);
1129
+ FPU_copy_from_user(register_base + offset, s, other);
11301130 if (offset)
1131
- __copy_from_user(register_base, s + other, offset);
1131
+ FPU_copy_from_user(register_base, s + other, offset);
11321132 RE_ENTRANT_CHECK_ON;
11331133
11341134 for (i = 0; i < 8; i++) {
....@@ -1146,7 +1146,7 @@
11461146 ((addr_modes.default_mode == PM16)
11471147 ^ (addr_modes.override.operand_size == OP_SIZE_PREFIX))) {
11481148 RE_ENTRANT_CHECK_OFF;
1149
- FPU_access_ok(VERIFY_WRITE, d, 14);
1149
+ FPU_access_ok(d, 14);
11501150 #ifdef PECULIAR_486
11511151 FPU_put_user(control_word & ~0xe080, (unsigned long __user *)d);
11521152 #else
....@@ -1174,7 +1174,7 @@
11741174 d += 0x0e;
11751175 } else {
11761176 RE_ENTRANT_CHECK_OFF;
1177
- FPU_access_ok(VERIFY_WRITE, d, 7 * 4);
1177
+ FPU_access_ok(d, 7 * 4);
11781178 #ifdef PECULIAR_486
11791179 control_word &= ~0xe080;
11801180 /* An 80486 sets nearly all of the reserved bits to 1. */
....@@ -1204,7 +1204,7 @@
12041204 d = fstenv(addr_modes, data_address);
12051205
12061206 RE_ENTRANT_CHECK_OFF;
1207
- FPU_access_ok(VERIFY_WRITE, d, 80);
1207
+ FPU_access_ok(d, 80);
12081208
12091209 /* Copy all registers in stack order. */
12101210 if (__copy_to_user(d, register_base + offset, other))