0.8.9.37:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 13 Apr 2004 13:31:36 +0000 (13:31 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 13 Apr 2004 13:31:36 +0000 (13:31 +0000)
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
src/runtime/thread.h
src/runtime/x86-arch.c
src/runtime/x86-arch.h
version.lisp-expr

index 552b0c2..a16e9de 100644 (file)
@@ -43,6 +43,7 @@ os_vm_size_t os_vm_page_size;
 
 #ifdef __NetBSD__
 #include <sys/resource.h>
+#include <sys/sysctl.h>
 #include <string.h>
 
 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? */
index e9039a1..d503c27 100644 (file)
@@ -5,8 +5,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <stddef.h>
-#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)
index fbe318b..2b1edba 100644 (file)
@@ -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]);
index 19d6cf6..e2b3e25 100644 (file)
 /* 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 */
index 0c2184a..3e76e30 100644 (file)
@@ -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"