forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/x86/math-emu/fpu_system.h
....@@ -104,9 +104,11 @@
104104 #define instruction_address (*(struct address *)&I387->soft.fip)
105105 #define operand_address (*(struct address *)&I387->soft.foo)
106106
107
-#define FPU_access_ok(x,y,z) if ( !access_ok(x,y,z) ) \
107
+#define FPU_access_ok(y,z) if ( !access_ok(y,z) ) \
108108 math_abort(FPU_info,SIGSEGV)
109109 #define FPU_abort math_abort(FPU_info, SIGSEGV)
110
+#define FPU_copy_from_user(to, from, n) \
111
+ do { if (copy_from_user(to, from, n)) FPU_abort; } while (0)
110112
111113 #undef FPU_IGNORE_CODE_SEGV
112114 #ifdef FPU_IGNORE_CODE_SEGV
....@@ -119,10 +121,10 @@
119121 /* A simpler test than access_ok() can probably be done for
120122 FPU_code_access_ok() because the only possible error is to step
121123 past the upper boundary of a legal code area. */
122
-#define FPU_code_access_ok(z) FPU_access_ok(VERIFY_READ,(void __user *)FPU_EIP,z)
124
+#define FPU_code_access_ok(z) FPU_access_ok((void __user *)FPU_EIP,z)
123125 #endif
124126
125
-#define FPU_get_user(x,y) get_user((x),(y))
126
-#define FPU_put_user(x,y) put_user((x),(y))
127
+#define FPU_get_user(x,y) do { if (get_user((x),(y))) FPU_abort; } while (0)
128
+#define FPU_put_user(x,y) do { if (put_user((x),(y))) FPU_abort; } while (0)
127129
128130 #endif