summaryrefslogtreecommitdiffstats
path: root/arch/i386/math-emu
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
commitc7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch)
tree3682407a599b8f9f03fc096298134cafba1c9b2f /arch/i386/math-emu
parent1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff)
o Merge with Linux 2.1.116.
o New Newport console code. o New G364 console code.
Diffstat (limited to 'arch/i386/math-emu')
-rw-r--r--arch/i386/math-emu/README4
-rw-r--r--arch/i386/math-emu/fpu_entry.c24
-rw-r--r--arch/i386/math-emu/reg_mul.c2
3 files changed, 18 insertions, 12 deletions
diff --git a/arch/i386/math-emu/README b/arch/i386/math-emu/README
index c6c774092..04434b618 100644
--- a/arch/i386/math-emu/README
+++ b/arch/i386/math-emu/README
@@ -131,7 +131,7 @@ code is:
movl %esp,[%ebx]
fld1
The FPU instruction may be (usually will be) loaded into the pre-fetch
-queue of the cpu before the mov instruction is executed. If the
+queue of the CPU before the mov instruction is executed. If the
destination of the 'movl' overlaps the FPU instruction then the bytes
in the prefetch queue and memory will be inconsistent when the FPU
instruction is executed. The emulator will be invoked but will not be
@@ -163,7 +163,7 @@ Speed.
The speed of floating point computation with the emulator will depend
upon instruction mix. Relative performance is best for the instructions
which require most computation. The simple instructions are adversely
-affected by the fpu instruction trap overhead.
+affected by the FPU instruction trap overhead.
Timing: Some simple timing tests have been made on the emulator functions.
diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/i386/math-emu/fpu_entry.c
index f120bbc49..9be6cc0fc 100644
--- a/arch/i386/math-emu/fpu_entry.c
+++ b/arch/i386/math-emu/fpu_entry.c
@@ -558,7 +558,7 @@ FPU_fwait_done:
RE_ENTRANT_CHECK_ON;
#endif DEBUG
- if (FPU_lookahead && !need_resched)
+ if (FPU_lookahead && !current->need_resched)
{
FPU_ORIG_EIP = FPU_EIP - code_base;
if ( valid_prefix(&byte1, (u_char **)&FPU_EIP,
@@ -677,14 +677,15 @@ void math_abort(struct info * info, unsigned int signal)
#define sstatus_word() \
((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top))
-void restore_i387_soft(void *s387, struct _fpstate *buf)
+int restore_i387_soft(void *s387, struct _fpstate *buf)
{
u_char *d = (u_char *)buf;
int offset, other, i, tags, regnr, tag, newtop;
RE_ENTRANT_CHECK_OFF;
FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
- __copy_from_user(&S387->cwd, d, 7*4);
+ if (__copy_from_user(&S387->cwd, d, 7*4))
+ return -1;
RE_ENTRANT_CHECK_ON;
d += 7*4;
@@ -695,9 +696,11 @@ void restore_i387_soft(void *s387, struct _fpstate *buf)
RE_ENTRANT_CHECK_OFF;
/* Copy all registers in stack order. */
- __copy_from_user(((u_char *)&S387->st_space)+offset, d, other);
+ if (__copy_from_user(((u_char *)&S387->st_space)+offset, d, other))
+ return -1;
if ( offset )
- __copy_from_user((u_char *)&S387->st_space, d+other, offset);
+ if (__copy_from_user((u_char *)&S387->st_space, d+other, offset))
+ return -1;
RE_ENTRANT_CHECK_ON;
/* The tags may need to be corrected now. */
@@ -716,10 +719,11 @@ void restore_i387_soft(void *s387, struct _fpstate *buf)
}
S387->twd = tags;
+ return 0;
}
-struct _fpstate * save_i387_soft(void *s387, struct _fpstate * buf)
+int save_i387_soft(void *s387, struct _fpstate * buf)
{
u_char *d = (u_char *)buf;
int offset = (S387->ftop & 7) * 10, other = 80 - offset;
@@ -742,10 +746,12 @@ struct _fpstate * save_i387_soft(void *s387, struct _fpstate * buf)
RE_ENTRANT_CHECK_OFF;
/* Copy all registers in stack order. */
- __copy_to_user(d, ((u_char *)&S387->st_space)+offset, other);
+ if (__copy_to_user(d, ((u_char *)&S387->st_space)+offset, other))
+ return -1;
if ( offset )
- __copy_to_user(d+other, (u_char *)&S387->st_space, offset);
+ if (__copy_to_user(d+other, (u_char *)&S387->st_space, offset))
+ return -1
RE_ENTRANT_CHECK_ON;
- return buf;
+ return 1;
}
diff --git a/arch/i386/math-emu/reg_mul.c b/arch/i386/math-emu/reg_mul.c
index 1ea92d48e..face9efee 100644
--- a/arch/i386/math-emu/reg_mul.c
+++ b/arch/i386/math-emu/reg_mul.c
@@ -7,7 +7,7 @@
| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia |
| E-mail billm@suburbia.net |
| |
- | Returns the tag of the result if no exceptions or errors occured. |
+ | Returns the tag of the result if no exceptions or errors occurred. |
| |
+---------------------------------------------------------------------------*/