Re: 2.1.124-pre1 (Fix for problem with 386/387 coupling.)

Niels Kristian Bech Jensen (nkbj@image.dk)
Wed, 30 Sep 1998 20:12:14 +0200 (CEST)


This patch fixes the problem with 386/387 coupling on my system (AMD
486DX-4/100 MHz):

diff -urN linux-pre-2.1.124-1/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
--- linux-pre-2.1.124-1/arch/i386/kernel/traps.c Wed Sep 30 18:38:15 1998
+++ linux/arch/i386/kernel/traps.c Wed Sep 30 20:05:16 1998
@@ -385,15 +385,20 @@
{
struct task_struct * task;

+ lock_kernel();
+ clts();
/*
* Save the info for the exception handler
* (this will also clear the error)
*/
task = current;
- unlazy_fpu(task);
+ __asm__ __volatile__("fnsave %0":"=m" (task->tss.i387.hard));
+ task->flags&=~PF_USEDFPU;
+ stts();
task->tss.trap_no = 16;
task->tss.error_code = 0;
force_sig(SIGFPE, task);
+ unlock_kernel();
}

asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)

--
Niels Kristian Bech Jensen - nkbj@image.dk - http://www.image.dk/~nkbj/

---------->> Stop software piracy --- use free software! <<----------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/