+---------------------------------------------------------------------------*/
#include <linux/signal.h>
-#include <linux/ptrace.h>
#include <asm/uaccess.h>
#include <asm/desc.h>
RE_ENTRANT_CHECK_ON;
#endif /* RE_ENTRANT_CHECKING */
- if (!current->used_math)
+ if (!used_math())
{
finit();
- current->used_math = 1;
+ set_used_math();
}
SETUP_DATA_AREA(arg);
if ( code_limit < code_base ) code_limit = 0xffffffff;
}
- FPU_lookahead = 1;
- if (current->ptrace & PT_PTRACED)
- FPU_lookahead = 0;
+ /* Don't run ahead if single-stepping. */
+ FPU_lookahead = (FPU_EFLAGS & X86_EFLAGS_TF) == 0;
if ( !valid_prefix(&byte1, (u_char __user **)&FPU_EIP,
&addr_modes.override) )
}
RE_ENTRANT_CHECK_OFF;
- FPU_code_verify_area(1);
+ FPU_code_access_ok(1);
FPU_get_user(FPU_modrm, (u_char __user *) FPU_EIP);
RE_ENTRANT_CHECK_ON;
FPU_EIP++;
*override = (overrides) { 0, 0, PREFIX_DEFAULT }; /* defaults */
RE_ENTRANT_CHECK_OFF;
- FPU_code_verify_area(1);
+ FPU_code_access_ok(1);
FPU_get_user(byte, ip);
RE_ENTRANT_CHECK_ON;
do_next_byte:
ip++;
RE_ENTRANT_CHECK_OFF;
- FPU_code_verify_area(1);
+ FPU_code_access_ok(1);
FPU_get_user(byte, ip);
RE_ENTRANT_CHECK_ON;
break;
int offset, other, i, tags, regnr, tag, newtop;
RE_ENTRANT_CHECK_OFF;
- FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
+ FPU_access_ok(VERIFY_READ, d, 7*4 + 8*10);
if (__copy_from_user(&S387->cwd, d, 7*4))
return -1;
RE_ENTRANT_CHECK_ON;
int offset = (S387->ftop & 7) * 10, other = 80 - offset;
RE_ENTRANT_CHECK_OFF;
- FPU_verify_area(VERIFY_WRITE, d, 7*4 + 8*10);
+ FPU_access_ok(VERIFY_WRITE, d, 7*4 + 8*10);
#ifdef PECULIAR_486
S387->cwd &= ~0xe080;
/* An 80486 sets nearly all of the reserved bits to 1. */
S387->fcs &= ~0xf8000000;
S387->fos |= 0xffff0000;
#endif /* PECULIAR_486 */
- __copy_to_user(d, &S387->cwd, 7*4);
+ if (__copy_to_user(d, &S387->cwd, 7*4))
+ return -1;
RE_ENTRANT_CHECK_ON;
d += 7*4;