[PATCH] 2.3.11 compile fails with FPU emulation

John Campbell (jcampbel@lynn.ci-n.com)
Thu, 22 Jul 1999 16:44:02 -0400 (EDT)


2.3.11 fails to compile with math emulation enabled. Last output
from the compiler was:

make[2]: Leaving directory `/usr/src/linux-2.3.11/arch/i386/lib'
make[1]: Leaving directory `/usr/src/linux-2.3.11/arch/i386/lib'
make -C arch/i386/math-emu
make[1]: Entering directory `/usr/src/linux-2.3.11/arch/i386/math-emu'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.3.11/arch/i386/math-emu'
gcc -D__KERNEL__ -I/usr/src/linux-2.3.11/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m386 -DCPU=386 -DPARANOID -fno-builtin -DPARANOID -fno-builtin -c -o fpu_entry.o fpu_entry.c
fpu_entry.c: In function `math_emulate':
fpu_entry.c:163: structure has no member named `tss'
fpu_entry.c:165: structure has no member named `tss'
fpu_entry.c:165: structure has no member named `tss'
fpu_entry.c:167: structure has no member named `tss'
.
.
. (about 100 more places where said structure member is referenced clipped)
.
.
fpu_entry.c:733: structure has no member named `tss'
make[2]: *** [fpu_entry.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.3.11/arch/i386/math-emu'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.3.11/arch/i386/math-emu'
make: *** [_dir_arch/i386/math-emu] Error 2
Command had non-zero exit status 2
10207.11user 663.29system 3:12:27elapsed 94%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

I consulted the 2.3.11 patch, made the obvious changes (below), and
it compiles, boots, and appears to run normally on my FPU-less 386 (well,
except for my ARCnet having intermittent fits, but I think that's a hardware
or cabling problem, and unrelated in any case).

--- fpu_entry.c.orig Thu Jul 22 15:25:01 1999
+++ fpu_entry.c Thu Jul 22 15:25:49 1999
@@ -283,8 +283,8 @@
FPU_EIP = FPU_ORIG_EIP; /* Point to current FPU instruction. */

RE_ENTRANT_CHECK_OFF;
- current->tss.trap_no = 16;
- current->tss.error_code = 0;
+ current->thread.trap_no = 16;
+ current->thread.error_code = 0;
send_sig(SIGFPE, current, 1);
return;
}
@@ -662,8 +662,8 @@
void math_abort(struct info * info, unsigned int signal)
{
FPU_EIP = FPU_ORIG_EIP;
- current->tss.trap_no = 16;
- current->tss.error_code = 0;
+ current->thread.trap_no = 16;
+ current->thread.error_code = 0;
send_sig(signal,current,1);
RE_ENTRANT_CHECK_OFF;
__asm__("movl %0,%%esp ; ret": :"g" (((long) info)-4));
--- fpu_system.h.orig Thu Jul 22 15:24:53 1999
+++ fpu_system.h Thu Jul 22 15:25:32 1999
@@ -33,7 +33,7 @@
#define SEG_EXPAND_DOWN(s) (((s).b & ((1 << 11) | (1 << 10))) \
== (1 << 10))

-#define I387 (current->tss.i387)
+#define I387 (current->thread.i387)
#define FPU_info (I387.soft.info)

#define FPU_CS (*(unsigned short *) &(FPU_info->___cs))

---
John Campbell
jcampbel@lynn.ci-n.com

QotD: Anyone can make an omelet with eggs. The trick is to make one with none.

- 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/