From e76b59734a46d1fdd9cbb4d7c561f10f5d8d29fa Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Sun, 22 Jan 2006 18:55:05 +0000 Subject: [PATCH] 0.9.8.48: Disable fast_bzero_sse for FreeBSD systems with kernels that don't have SSE support. Patch by NIIMI Satoshi on sbcl-devel, "Re: upcoming sbcl-0.9.9 release". --- src/runtime/bsd-os.c | 34 ++++++++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index a74734b..2c84a10 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -51,6 +51,12 @@ os_vm_size_t os_vm_page_size; static void netbsd_init(); #endif /* __NetBSD__ */ +#ifdef __FreeBSD__ +#include + +static void freebsd_init(); +#endif /* __FreeBSD__ */ + void os_init(char *argv[], char *envp[]) { @@ -59,6 +65,9 @@ os_init(char *argv[], char *envp[]) #ifdef __NetBSD__ netbsd_init(); #endif /* __NetBSD__ */ +#ifdef __FreeBSD__ + freebsd_init(); +#endif /* __FreeBSD__ */ } int *os_context_pc_addr(os_context_t *context) @@ -279,6 +288,31 @@ The system may fail to start.\n", } } #endif /* __NetBSD__ */ + +#ifdef __FreeBSD__ +static void freebsd_init() +{ + /* Quote from sbcl-devel (NIIMI Satoshi): "Some OSes, like FreeBSD + * 4.x with GENERIC kernel, does not enable SSE support even on + * SSE capable CPUs". Detect this situation and skip the + * fast_bzero sse/base selection logic that's normally done in + * x86-assem.S. + */ +#ifdef LISP_FEATURE_X86 + extern void fast_bzero_base(void *, size_t); + extern void (*fast_bzero_pointer)(void *, size_t); + size_t len; + int instruction_sse; + + len = sizeof(instruction_sse); + if (sysctlbyname("hw.instruction_sse", &instruction_sse, &len, NULL, 0) != 0 + || instruction_sse == 0) { + /* Use the non-SSE version*/ + fast_bzero_pointer = fast_bzero_base; + } +#endif /* LISP_FEATURE_X86 */ +} +#endif /* __FreeBSD__ */ /* threads */ diff --git a/version.lisp-expr b/version.lisp-expr index d7e5e36..2b55f22 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.8.47" +"0.9.8.48" -- 1.7.10.4