REMOVE MATH EMULATION CODE FOR 387 & 486 USERS
authorPoul-Henning Kamp <phk@FreeBSD.org>
Sat, 28 Nov 1992 00:00:00 +0000 (00:00 +0000)
committerPoul-Henning Kamp <phk@FreeBSD.org>
Sat, 28 Nov 1992 00:00:00 +0000 (00:00 +0000)
        This patch allows you to cut the size of your kernel by quite a
chunk, but only if you have a numeric hardware device, ie. i387 or i486.
On systems with the right hardware add either of these lines to your
config file:
options "i486" OR options "i387"
run config and rebuild the kernel.

AUTHOR: Poul-Henning Kamp
386BSD-Patchkit: patch00060

usr/src/sys.386bsd/i386/i386/math_emulate.c

index e33b51a..faf55a4 100644 (file)
  *
  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
  * --------------------         -----   ----------------------
  *
  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
  * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00046
+ * CURRENT PATCH LEVEL:         2       00060
  * --------------------         -----   ----------------------
  *
  * 19 Sep 92   Ishii Masahiro          Fix 0x1fd instruction
  *             kym@bingsuns.cc.binghamton.edu          Fix fscale
  * --------------------         -----   ----------------------
  *
  * 19 Sep 92   Ishii Masahiro          Fix 0x1fd instruction
  *             kym@bingsuns.cc.binghamton.edu          Fix fscale
+ * 28 Nov 92   Poul-Henning Kamp       Reduce kernel size if you have
+ *                                     a 387 or 486 chip
  */
 
 #include "machine/cpu.h"
  */
 
 #include "machine/cpu.h"
@@ -76,6 +78,10 @@ put_fs_long(unsigned long val, unsigned long *adr) { (void)suword(adr,val); }
 
 math_emulate(struct trapframe * info)
 {
 
 math_emulate(struct trapframe * info)
 {
+#if defined(i486) || defined(i387)
+       panic("math_emulate(), shouldn't happen with -Di486 or -Di387");
+}
+#else
        unsigned short code;
        temp_real tmp;
        char * address;
        unsigned short code;
        temp_real tmp;
        char * address;
@@ -1478,3 +1484,4 @@ void int_to_real(const temp_int * a, temp_real * b)
                        :"0" (b->a),"1" (b->b));
        }
 }
                        :"0" (b->a),"1" (b->b));
        }
 }
+#endif /* defined(i486) || defined(i387) */