summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-10-09 18:30:08 +0000
committerbde <bde@FreeBSD.org>1996-10-09 18:30:08 +0000
commitf9a9c0927cef7b1135d81c8a9aa213d33b8e9132 (patch)
tree47aef901dda22dfa3003ec48836f9da8313f122e
parent8beec6c65dacf75b397e6eb6a3ad9101b9660c22 (diff)
downloadFreeBSD-src-f9a9c0927cef7b1135d81c8a9aa213d33b8e9132.zip
FreeBSD-src-f9a9c0927cef7b1135d81c8a9aa213d33b8e9132.tar.gz
Enable the i586-optimized bcopy if the cpu is a "586" and option
I586_OPTIMIZED_BCOPY is configured. Similarly for bzero/I586_OPTIMIZED_BZERO. Fake 586's had better have a hardware FPU with non-broken exception handling (we mask exceptions, but broken exception handling may trap on the instructions that do the masking). I guess this means that the routines won't work on most 386's or FPUless 486's even when they have a h/w FPU.
-rw-r--r--sys/amd64/amd64/identcpu.c20
-rw-r--r--sys/i386/i386/identcpu.c20
2 files changed, 32 insertions, 8 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c
index 81a24e7..0353462 100644
--- a/sys/amd64/amd64/identcpu.c
+++ b/sys/amd64/amd64/identcpu.c
@@ -35,9 +35,11 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.4 1996/08/10 08:04:24 peter Exp $
+ * $Id: identcpu.c,v 1.5 1996/09/06 23:07:02 phk Exp $
*/
+#include "opt_temporary.h" /* for I586_OPTIMIZED_B* */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
@@ -53,9 +55,12 @@
#include <machine/md_var.h>
/* XXX - should be in header file */
-extern void i486_bzero __P((void *, size_t));
-extern void i586_bzero __P((void *, size_t));
-extern void i686_bzero __P((void *, size_t));
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+
+void i486_bzero __P((void *buf, size_t len));
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
void identifycpu(void); /* XXX should be in different header file */
void earlysetcpuclass(void);
@@ -173,6 +178,13 @@ identifycpu(void)
(i586_ctr_freq + 4999) / 1000000,
((i586_ctr_freq + 4999) / 10000) % 100);
printf("586");
+#ifdef I586_OPTIMIZED_BCOPY
+ bcopy_vector = i586_bcopy;
+ ovbcopy_vector = i586_bcopy;
+#endif
+#ifdef I586_OPTIMIZED_BZERO
+ bzero = i586_bzero;
+#endif
break;
#endif
#if defined(I686_CPU)
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 81a24e7..0353462 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -35,9 +35,11 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.4 1996/08/10 08:04:24 peter Exp $
+ * $Id: identcpu.c,v 1.5 1996/09/06 23:07:02 phk Exp $
*/
+#include "opt_temporary.h" /* for I586_OPTIMIZED_B* */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
@@ -53,9 +55,12 @@
#include <machine/md_var.h>
/* XXX - should be in header file */
-extern void i486_bzero __P((void *, size_t));
-extern void i586_bzero __P((void *, size_t));
-extern void i686_bzero __P((void *, size_t));
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+
+void i486_bzero __P((void *buf, size_t len));
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
void identifycpu(void); /* XXX should be in different header file */
void earlysetcpuclass(void);
@@ -173,6 +178,13 @@ identifycpu(void)
(i586_ctr_freq + 4999) / 1000000,
((i586_ctr_freq + 4999) / 10000) % 100);
printf("586");
+#ifdef I586_OPTIMIZED_BCOPY
+ bcopy_vector = i586_bcopy;
+ ovbcopy_vector = i586_bcopy;
+#endif
+#ifdef I586_OPTIMIZED_BZERO
+ bzero = i586_bzero;
+#endif
break;
#endif
#if defined(I686_CPU)
OpenPOWER on IntegriCloud