0.8.9.29:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 8 Apr 2004 13:26:01 +0000 (13:26 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 8 Apr 2004 13:26:01 +0000 (13:26 +0000)
Merge netbsd_branch

1  2 
CREDITS
NEWS
src/code/cold-init.lisp
src/runtime/gencgc.c
src/runtime/interrupt.c
src/runtime/x86-assem.S
tools-for-build/grovel-headers.c
version.lisp-expr

diff --combined CREDITS
+++ b/CREDITS
@@@ -608,6 -608,11 +608,11 @@@ Dave McDonald
    He made a lot of progress toward getting SBCL to be bootstrappable
    under CLISP.
  
+ Perry E. Metzger:
+   He ported SBCL to NetBSD with newer signals, building on the
+   work of Valtteri Vuorikoski.  He also provided various cleanups to
+   the C runtime.
  Gerd Moellman:
    He has made many cleanups and improvements, small and large, in
    CMU CL (mostly in PCL), which we have gratefully ported to SBCL.  Of
@@@ -647,12 -652,6 +652,12 @@@ Stig Erik Sandoe
    He showed how to convince the GNU toolchain to build SBCL in a way
    which supports callbacks from C code into SBCL.
  
 +Rudi Schlatte:
 +  He ported Paul Foley's simple-streams implementation from cmucl,
 +  converted the sbcl manual to Texinfo and wrote a documentation
 +  string extractor that keeps function documentation in the manual
 +  current.
 +
  Nikodemus Siivola:
    He provided build fixes, in particular to tame the SunOS toolchain,
    and has fixed many (stream-related and other) bugs besides.
diff --combined NEWS
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -2364,20 -2364,10 +2364,23 @@@ changes in sbcl-0.8.9 relative to sbcl-
         the readtable currently in effect.
  
  changes in sbcl-0.8.10 relative to sbcl-0.8.9:
++  * Support for the forthcoming 2.0 version of the NetBSD kernel
++    running on x86 hardware has been added.  (thanks to Perry
++    E. Metzger most immediately, and others for their past work)
 +  * [placeholder for DX summary]
 +    ** user code with &REST lists declared dynamic-extent, under high
 +       speed or space and low safety and debug optimization policy.
 +  * The manual has been converted to Texinfo format and the debugger
-     chapter from the cmucl manual has been added
++    chapter from the cmucl manual has been added.
 +  * A facility has been added to extract documentation strings from
 +    sbcl and store them as Texinfo-formatted snippets for inclusion in
 +    the manual (via Texinfo's @include directive)
    * bug fix: compiler emitted division in optimized DEREF.  (thanks for
      the test case to Dave Roberts)
    * bug fix: multidimensional simple arrays loaded from FASLs had fill
      pointers.  (reported by Sean Ross)
 +  * bug fix: PROFILE output is printed nicely even for large numerical
-       values. (thanks to Zach Beane)
++    values.  (thanks to Zach Beane)
  
  planned incompatible changes in 0.8.x:
    * (not done yet, but planned:) When the profiling interface settles
diff --combined src/code/cold-init.lisp
@@@ -49,7 -49,7 +49,7 @@@
  \f
  ;;;; putting ourselves out of our misery when things become too much to bear
  
 -(declaim (ftype (function (simple-string) nil) critically-unreachable))
 +(declaim (ftype (function (simple-string) nil) !cold-lose))
  (defun !cold-lose (msg)
    (%primitive print msg)
    (%primitive print "too early in cold init to recover from errors")
    ;; FIXME: This list of modes should be defined in one place and
    ;; explicitly shared between here and REINIT.
  
-   ;; Why was this marked #!+alpha?  CMUCL does it here on all architectures
-   (set-floating-point-modes :traps '(:overflow :invalid :divide-by-zero))
+   ;; FIXME: For some unknown reason, NetBSD/x86 won't run with the
+   ;; :invalid trap enabled. That should be fixed, but not today...
+   ;; PEM -- April 5, 2004
+   (set-floating-point-modes
+    :traps '(:overflow #!-netbsd :invalid :divide-by-zero))
  
    (show-and-call !class-finalize)
  
@@@ -288,8 -291,22 +291,12 @@@ instead (which is another name for the 
        ;; LEAST-NEGATIVE-SINGLE-FLOAT, so the :UNDERFLOW exceptions are
        ;; disabled by default. Joe User can explicitly enable them if
        ;; desired.
-       (set-floating-point-modes :traps '(:overflow :invalid :divide-by-zero))
+       ;;
+       ;; see also comment at the previous SET-FLOATING-POINT-MODES
+       ;; call site.
+       (set-floating-point-modes
+        :traps '(:overflow #!-netbsd :invalid :divide-by-zero))
 -      (sb!thread::maybe-install-futex-functions)
 -
 -      ;; Clear pseudo atomic in case this core wasn't compiled with
 -      ;; support.
 -      ;;
 -      ;; FIXME: In SBCL our cores are always compiled with support. So
 -      ;; we don't need to do this, do we? At least not for this
 -      ;; reason.. (Perhaps we should do it anyway in case someone
 -      ;; manages to save an image from within a pseudo-atomic-atomic
 -      ;; operation?)
 -      #!+x86 (setf *pseudo-atomic-atomic* 0)))
 +      (sb!thread::maybe-install-futex-functions)))
    (gc-on)
    (gc))
  \f
diff --combined src/runtime/gencgc.c
@@@ -69,7 -69,7 +69,7 @@@ boolean interrupt_maybe_gc_int(int, sig
  boolean enable_page_protection = 1;
  
  /* Should we unmap a page and re-mmap it to have it zero filled? */
- #if defined(__FreeBSD__) || defined(__OpenBSD__)
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
  /* comment from cmucl-2.4.8: This can waste a lot of swap on FreeBSD
   * so don't unmap there.
   *
@@@ -295,7 -295,7 +295,7 @@@ count_generation_pages(int generation
      return count;
  }
  
 -/* Count the number of dont_move pages. */
 +#if QSHOW
  static int
  count_dont_move_pages(void)
  {
      }
      return count;
  }
 +#endif /* QSHOW */
  
  /* Work through the pages and add up the number of bytes used for the
   * given generation. */
@@@ -2968,6 -2967,7 +2968,6 @@@ unprotect_oldspace(void
   * assumes that all objects have been copied or promoted to an older
   * generation. Bytes_allocated and the generation bytes_allocated
   * counter are updated. The number of bytes freed is returned. */
 -extern void i586_bzero(void *addr, int nbytes);
  static int
  free_oldspace(void)
  {
            os_invalidate(page_start, PAGE_BYTES*(last_page-first_page));
            addr = os_validate(page_start, PAGE_BYTES*(last_page-first_page));
            if (addr == NULL || addr != page_start) {
 -              /* Is this an error condition? I couldn't really tell from
 -               * the old CMU CL code, which fprintf'ed a message with
 -               * an exclamation point at the end. But I've never seen the
 -               * message, so it must at least be unusual..
 -               *
 -               * (The same condition is also tested for in gc_free_heap.)
 -               *
 -               * -- WHN 19991129 */
 -              lose("i586_bzero: page moved, 0x%08x ==> 0x%08x",
 -                   page_start,
 +              lose("free_oldspace: page moved, 0x%08x ==> 0x%08x",page_start,
                     addr);
            }
        } else {
            int *page_start;
  
            page_start = (int *)page_address(first_page);
 -          i586_bzero(page_start, PAGE_BYTES*(last_page-first_page));
 +          memset(page_start, 0,PAGE_BYTES*(last_page-first_page));
        }
  
        first_page = last_page;
@@@ -3509,8 -3518,8 +3509,8 @@@ garbage_collect_generation(int generati
      for_each_thread(th) {
        void **ptr;
        void **esp=(void **)-1;
 -      int i,free;
  #ifdef LISP_FEATURE_SB_THREAD
 +      int i,free;
        if(th==arch_os_get_current_thread()) {
            esp = (void **) &raise;
        } else {
diff --combined src/runtime/interrupt.c
@@@ -612,11 -612,9 +612,11 @@@ extern lispobj call_into_lisp(lispobj f
  extern void post_signal_tramp(void);
  void arrange_return_to_lisp_function(os_context_t *context, lispobj function)
  {
 +#ifndef LISP_FEATURE_X86
      void * fun=native_pointer(function);
 -    char *code = &(((struct simple_fun *) fun)->code);
 -    
 +    void *code = &(((struct simple_fun *) fun)->code);
 +#endif    
 +
      /* Build a stack frame showing `interrupted' so that the
       * user's backtrace makes (as much) sense (as usual) */
  #ifdef LISP_FEATURE_X86
@@@ -730,7 -728,7 +730,7 @@@ boolean handle_control_stack_guard_trig
  }
  
  #ifndef LISP_FEATURE_GENCGC
- /* This function gets called from the SIGSEGV (for e.g. Linux or
+ /* This function gets called from the SIGSEGV (for e.g. Linux, NetBSD, &
   * OpenBSD) or SIGBUS (for e.g. FreeBSD) handler. Here we check
   * whether the signal was due to treading on the mprotect()ed zone -
   * and if so, arrange for a GC to happen. */
diff --combined src/runtime/x86-assem.S
  #include "genesis/thread.h"
        
  /* Minimize conditionalization for different OS naming schemes. */
- #if defined __linux__  || defined __FreeBSD__ /* (but *not* OpenBSD) */
+ #if defined __linux__  || defined __FreeBSD__ || defined __NetBSD__ /* (but *not* OpenBSD) */
  #define GNAME(var) var
  #else
  #define GNAME(var) _##var
  #endif
  
- /* Get the right type of alignment. Linux and FreeBSD (but not OpenBSD)
+ /* Get the right type of alignment. Linux, FreeBSD and NetBSD (but not OpenBSD)
   * want alignment in bytes. */
- #if defined(__linux__) || defined(__FreeBSD__)
+ #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
  #define align_4byte   4
  #define align_8byte   8
  #define align_16byte  16
@@@ -340,6 -340,30 +340,6 @@@ GNAME(do_pending_interrupt)
        ret
        .size   GNAME(do_pending_interrupt),.-GNAME(do_pending_interrupt)
  \f
 -#ifdef LISP_FEATURE_GENCGC
 -/* This is a fast bzero using the FPU. The first argument is the start
 - * address which needs to be aligned on an 8 byte boundary, the second
 - * argument is the number of bytes, which must be a nonzero multiple
 - * of 8 bytes. */
 -/* FIXME whether this is still faster than using the OS's bzero or
 - * equivalent, we don't know */
 -      .text
 -      .globl  GNAME(i586_bzero)
 -      .type   GNAME(i586_bzero),@function
 -      .align  align_4byte,0x90
 -GNAME(i586_bzero):
 -      movl    4(%esp),%edx    # Load the start address.
 -      movl    8(%esp),%eax    # Load the number of bytes.
 -      fldz
 -l1:   fstl    0(%edx)
 -      addl    $8,%edx
 -      subl    $8,%eax
 -      jnz     l1
 -      fstp    %st(0)
 -      ret
 -      .size   GNAME(i586_bzero),.-GNAME(i586_bzero)
 -#endif        
 -\f
  
  /*
   * Allocate bytes and return the start of the allocated space
@@@ -76,7 -76,7 +76,7 @@@ main(int argc, char *argv[]
      DEFTYPE("uid-t",   uid_t);
      printf("\n");
  
-     printf(";;; fcntl.h (or unistd.h on OpenBSD)\n");
+     printf(";;; fcntl.h (or unistd.h on OpenBSD and NetBSD)\n");
      defconstant("r_ok", R_OK);
      defconstant("w_ok", W_OK);
      defconstant("x_ok", X_OK);
      DEFSIGNAL(SIGBUS);
      DEFSIGNAL(SIGCHLD);
      DEFSIGNAL(SIGCONT);
 -/* FIXME: Maybe #ifdef SIGEMT would be a smarter conditional? */
 -#if (!(defined LISP_FEATURE_LINUX) || !((defined LISP_FEATURE_PPC) || (defined LISP_FEATURE_X86)))
 +#ifdef SIGEMT
      DEFSIGNAL(SIGEMT);
  #endif
      DEFSIGNAL(SIGFPE);
diff --combined version.lisp-expr
@@@ -17,4 -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.28"
 -"0.8.9.6.netbsd.3"
++"0.8.9.29"