From 64d188522b43bd5a86238f3d453d2b3c323bc0ae Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 13 Apr 2004 13:31:36 +0000 Subject: [PATCH] 0.8.9.37: NetBSD fixes ... remove one __NetBSD__ which got in the way; ... include kernel revision detection. ... also include less expensive spinlock definitions for x86/unithread builds. --- src/runtime/bsd-os.c | 16 ++++++++++++++++ src/runtime/thread.h | 4 ++-- src/runtime/x86-arch.c | 2 +- src/runtime/x86-arch.h | 18 +++++++++++++++++- version.lisp-expr | 2 +- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 552b0c2..a16e9de 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -43,6 +43,7 @@ os_vm_size_t os_vm_page_size; #ifdef __NetBSD__ #include +#include #include static void netbsd_init(); @@ -232,6 +233,21 @@ os_install_interrupt_handlers(void) static void netbsd_init() { struct rlimit rl; + int mib[2], osrev; + size_t len; + + /* Are we running on a sufficiently functional kernel? */ + mib[0] = CTL_KERN; + mib[1] = KERN_OSREV; + + len = sizeof(osrev); + sysctl(mib, 2, &osrev, &len, NULL, 0); + + /* If we're older than 2.0... */ + if (osrev < 200000000) { + fprintf(stderr, "osrev = %d (needed at least 200000000).\n", osrev); + lose("NetBSD kernel too old to run sbcl.\n"); + } /* NetBSD counts mmap()ed space against the process's data size limit, * so yank it up. This might be a nasty thing to do? */ diff --git a/src/runtime/thread.h b/src/runtime/thread.h index e9039a1..d503c27 100644 --- a/src/runtime/thread.h +++ b/src/runtime/thread.h @@ -5,8 +5,8 @@ #include #include #include -#include "runtime.h" #include "sbcl.h" +#include "runtime.h" #include "os.h" #include "interrupt.h" #ifdef LISP_FEATURE_GENCGC @@ -104,7 +104,7 @@ static inline os_context_t *get_interrupt_context_for_thread(struct thread *th) * much stuff like struct thread and all_threads to be defined, which * usually aren't by that time. So, it's here instead. Sorry */ -inline static struct thread *arch_os_get_current_thread() { +static inline struct thread *arch_os_get_current_thread() { #if defined(LISP_FEATURE_SB_THREAD) && defined (LISP_FEATURE_X86) register struct thread *me=0; if(all_threads) diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index fbe318b..2b1edba 100644 --- a/src/runtime/x86-arch.c +++ b/src/runtime/x86-arch.c @@ -55,7 +55,7 @@ context_eflags_addr(os_context_t *context) return &context->uc_mcontext.gregs[16]; #elif defined __FreeBSD__ return &context->uc_mcontext.mc_eflags; -#elif defined __OpenBSD__ || defined __NetBSD__ +#elif defined __OpenBSD__ return &context->sc_eflags; #elif defined __NetBSD__ return &(context->uc_mcontext.__gregs[_REG_EFL]); diff --git a/src/runtime/x86-arch.h b/src/runtime/x86-arch.h index 19d6cf6..e2b3e25 100644 --- a/src/runtime/x86-arch.h +++ b/src/runtime/x86-arch.h @@ -10,8 +10,10 @@ /* FIXME: Do we also want * #define ARCH_HAS_FLOAT_REGISTERS * here? (The answer wasn't obvious to me when merging the - * architecture-abstracting patches for CSR's SPARC port. -- WHN 2002-02-15) */ + * architecture-abstracting patches for CSR's SPARC port. -- WHN + * 2002-02-15) */ +#ifdef LISP_FEATURE_SB_THREAD static inline void get_spinlock(lispobj *word,int value) { @@ -31,4 +33,18 @@ release_spinlock(lispobj *word) *word=0; } +#else + +static inline void +get_spinlock(lispobj *word, int value) +{ + *word = value; +} + +static inline void +release_spinlock(lispobj *word) { + *word = 0; +} + +#endif /* LISP_FEATURE_SB_THREAD */ #endif /* _X86_ARCH_H */ diff --git a/version.lisp-expr b/version.lisp-expr index 0c2184a..3e76e30 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.8.9.36" +"0.8.9.37" -- 1.7.10.4