? src/runtime/Config.x86-dragonfly
Index: make-config.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-config.sh,v
retrieving revision 1.49
diff -u -p -r1.49 make-config.sh
--- make-config.sh	20 Jun 2005 16:52:54 -0000	1.49
+++ make-config.sh	20 Jul 2005 15:05:18 -0000
@@ -155,6 +155,15 @@ case `uname` in 
 	printf ' :darwin' >> $ltf
 	ln -s Config.$sbcl_arch-darwin Config
 	;;
+    DragonFly)
+	printf ' :bsd' >> $ltf
+	ln -s $sbcl_arch-bsd-os.h target-arch-os.h
+	ln -s bsd-os.h target-os.h
+	printf ' :elf' >> $ltf
+	printf ' :dragonfly' >> $ltf
+	sbcl_os="dragonfly"
+	ln -s Config.$sbcl_arch-dragonfly Config
+	;;
     SunOS)
 	printf ' :elf' >> $ltf
         printf ' :sunos' >> $ltf
Index: src/code/bsd-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/bsd-os.lisp,v
retrieving revision 1.10
diff -u -p -r1.10 bsd-os.lisp
--- src/code/bsd-os.lisp	14 Jul 2005 16:30:13 -0000	1.10
+++ src/code/bsd-os.lisp	20 Jul 2005 15:05:19 -0000
@@ -18,7 +18,8 @@
        #!+FreeBSD "FreeBSD"
        #!+OpenBSD "OpenBSD"
        #!+NetBSD "NetBSD"
-       #!+Darwin "Darwin"))
+       #!+Darwin "Darwin"
+       #!+DragonFly "DragonFly"))
 
 (defvar *software-version* nil)
 
Index: src/code/debug-int.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/debug-int.lisp,v
retrieving revision 1.97
diff -u -p -r1.97 debug-int.lisp
--- src/code/debug-int.lisp	14 Jul 2005 16:30:31 -0000	1.97
+++ src/code/debug-int.lisp	20 Jul 2005 15:05:26 -0000
@@ -619,11 +619,11 @@
                                (format t
                                        "debug: both still valid ~S ~S ~S ~S~%"
                                        lisp-ocfp lisp-ra c-ocfp c-ra))
-                      #!+freebsd
+                      #!+(or freebsd dragonfly)
                       (if (sap> lisp-ocfp c-ocfp)
                         (values lisp-ra lisp-ocfp)
                         (values c-ra c-ocfp))
-                       #!-freebsd
+                       #!-(or freebsd dragonfly)
                        (values lisp-ra lisp-ocfp))
                      (lisp-path-fp
                       ;; The lisp convention is looking good.
Index: src/code/float-trap.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/float-trap.lisp,v
retrieving revision 1.18
diff -u -p -r1.18 float-trap.lisp
--- src/code/float-trap.lisp	14 Jul 2005 16:30:34 -0000	1.18
+++ src/code/float-trap.lisp	20 Jul 2005 15:05:26 -0000
@@ -171,7 +171,7 @@
            (error 'floating-point-underflow))
           ((not (zerop (logand float-inexact-trap-bit traps)))
            (error 'floating-point-inexact))
-          #!+freebsd
+          #!+(or freebsd dragonfly)
           ((zerop (ldb float-exceptions-byte modes))
            ;; I can't tell what caused the exception!!
            (error 'floating-point-exception
Index: src/code/unix.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/unix.lisp,v
retrieving revision 1.56
diff -u -p -r1.56 unix.lisp
--- src/code/unix.lisp	14 Jul 2005 16:30:40 -0000	1.56
+++ src/code/unix.lisp	20 Jul 2005 15:05:27 -0000
@@ -311,14 +311,14 @@ SYSCALL-FORM. Repeat evaluation of SYSCA
   ;; a constant. Going the grovel_headers route doesn't seem to be
   ;; helpful, either, as Solaris doesn't export PATH_MAX from
   ;; unistd.h.
-  #!-(or linux openbsd freebsd netbsd sunos osf1 darwin) (,stub,)
-  #!+(or linux openbsd freebsd netbsd sunos osf1 darwin)
+  #!-(or linux openbsd freebsd netbsd sunos osf1 darwin dragonfly) (,stub,)
+  #!+(or linux openbsd freebsd netbsd sunos osf1 darwin dragonfly)
   (or (newcharstar-string (alien-funcall (extern-alien "getcwd"
                                                        (function (* char)
                                                                  (* char)
                                                                  size-t))
                                          nil
-                                         #!+(or linux openbsd freebsd netbsd darwin) 0
+                                         #!+(or linux openbsd freebsd netbsd darwin dragonfly) 0
                                          #!+(or sunos osf1) 1025))
       (simple-perror "getcwd")))
 
Index: src/compiler/x86/parms.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/parms.lisp,v
retrieving revision 1.47
diff -u -p -r1.47 parms.lisp
--- src/compiler/x86/parms.lisp	14 Jul 2005 19:13:48 -0000	1.47
+++ src/compiler/x86/parms.lisp	20 Jul 2005 15:05:27 -0000
@@ -176,6 +176,21 @@
   (def!constant linkage-table-space-start #x90000000)
   (def!constant linkage-table-space-end   #x91000000))
 
+#!+dragonfly
+(progn
+  (def!constant read-only-space-start     #x10000000)
+  (def!constant read-only-space-end       #x1ffff000)
+
+  (def!constant static-space-start        #x30000000)
+  (def!constant static-space-end          #x37fff000)
+
+  (def!constant dynamic-space-start       #x48000000)
+  (def!constant dynamic-space-end         #x88000000)
+
+  ;; In CMUCL:  0xB0000000->0xB1000000
+  (def!constant linkage-table-space-start #x90000000)
+  (def!constant linkage-table-space-end   #x91000000))
+
 #!+openbsd
 (progn
   (def!constant read-only-space-start     #x40000000)
Index: src/runtime/bsd-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/bsd-os.c,v
retrieving revision 1.27
diff -u -p -r1.27 bsd-os.c
--- src/runtime/bsd-os.c	14 Jul 2005 15:41:11 -0000	1.27
+++ src/runtime/bsd-os.c	20 Jul 2005 15:05:28 -0000
@@ -62,7 +62,7 @@ void os_init(void)
 
 int *os_context_pc_addr(os_context_t *context)
 {
-#if defined __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
     return CONTEXT_ADDR_FROM_STEM(eip);
 #elif defined __OpenBSD__
     return CONTEXT_ADDR_FROM_STEM(pc);
@@ -81,7 +81,8 @@ os_context_sigmask_addr(os_context_t *co
     /* (Unlike most of the other context fields that we access, the
      * signal mask field is a field of the basic, outermost context
      * struct itself both in FreeBSD 4.0 and in OpenBSD 2.6.) */
-#if defined __FreeBSD__  || __NetBSD__ || defined LISP_FEATURE_DARWIN
+#if defined(__FreeBSD__)  || defined(__NetBSD__) || \
+	defined(__DragonFly__) || defined(LISP_FEATURE_DARWIN)
     return &context->uc_sigmask;
 #elif defined __OpenBSD__
     return &context->sc_mask;
@@ -180,7 +181,8 @@ memory_fault_handler(int signal, siginfo
 {
     /* The way that we extract low level information like the fault
      * address is not specified by POSIX. */
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+	defined(__DragonFly__)
     void *fault_addr = siginfo->si_addr;
 #elif defined LISP_FEATURE_DARWIN
     void *fault_addr = siginfo->si_addr;
Index: src/runtime/bsd-os.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/bsd-os.h,v
retrieving revision 1.14
diff -u -p -r1.14 bsd-os.h
--- src/runtime/bsd-os.h	17 Apr 2005 19:41:28 -0000	1.14
+++ src/runtime/bsd-os.h	20 Jul 2005 15:05:28 -0000
@@ -9,7 +9,7 @@
  * files for more information.
  */
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <osreldate.h>
 #endif
 
@@ -37,11 +37,11 @@ typedef int os_context_register_t;
 /* name defined for compatibility between OpenBSD 3.1 sigaltstack(2) and
  * Linux sigaltstack(2) */
 typedef struct sigaltstack stack_t;
-#elif defined __FreeBSD__
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
 /* FreeBSD 4.6 and NetBSD 1.6 already have stack_t defined. */
 #endif
 
-#if defined __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 /* Note: The man page for sigaction(2) in FreeBSD 4.0 says that this
  * is an mcontext_t, but according to comments by Raymond Wiker in the
  * original FreeBSD port of SBCL, that's wrong, it's actually a
Index: src/runtime/gencgc.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v
retrieving revision 1.74
diff -u -p -r1.74 gencgc.c
--- src/runtime/gencgc.c	14 Jul 2005 15:41:11 -0000	1.74
+++ src/runtime/gencgc.c	20 Jul 2005 15:05:31 -0000
@@ -65,7 +65,8 @@ static void  gencgc_pickup_dynamic(void)
 boolean enable_page_protection = 1;
 
 /* Should we unmap a page and re-mmap it to have it zero filled? */
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+	defined(__DragonFly__)
 /* comment from cmucl-2.4.8: This can waste a lot of swap on FreeBSD
  * so don't unmap there.
  *
Index: src/runtime/undefineds.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/undefineds.h,v
retrieving revision 1.17
diff -u -p -r1.17 undefineds.h
--- src/runtime/undefineds.h	14 Jul 2005 15:41:21 -0000	1.17
+++ src/runtime/undefineds.h	20 Jul 2005 15:05:31 -0000
@@ -39,7 +39,8 @@ F(brk)
      || defined(SVR4) \
      || defined(__FreeBSD__) \
      || defined(__OpenBSD__) \
-     || defined(__NetBSD__)
+     || defined(__NetBSD__) \
+     || defined(__DragonFly__)
 F(cfgetospeed)
 F(cfsetospeed)
 F(cfgetispeed)
@@ -153,7 +154,7 @@ F(sigreturn)
 #if !defined(SVR4)
 F(sigsetmask)
 #endif
-#if !defined(SVR4) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+#if !defined(SVR4) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
 F(sigstack)
 F(sigvec)
 #endif
@@ -179,7 +180,8 @@ F(readdir)
      || defined(__FreeBSD__) \
      || defined(__OpenBSD__) \
      || defined(__NetBSD__) \
-     || defined(__linux__)
+     || defined(__linux__) \
+     || defined(__DragonFly__)
 F(tcgetattr)
 F(tcsetattr)
 F(tcsendbreak)
@@ -197,7 +199,8 @@ F(umask)
      && !defined(SOLARIS) \
      && !defined(__OpenBSD__) \
      && !defined(__FreeBSD__) \
-     && !defined(__NetBSD__)
+     && !defined(__NetBSD__) \
+     && !defined(__DragonFly__)
 F(umount)
 #endif
 F(unlink)
@@ -207,7 +210,7 @@ F(utimes)
 #ifndef irix
 F(vfork)
 #endif
-#if !defined(osf1) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+#if !defined(osf1) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
 F(vhangup)
 #endif
 F(wait)
@@ -260,11 +263,11 @@ F(gethostbyaddr)
 /* FIXME: NetBSD plays some renaming games, and so cannot simply
    reference symbols here.  "NetBSD needs to get fixed here too PEM
    2004-03-27" */
-#if defined(SVR4) || defined(__FreeBSD__)
+#if defined(SVR4) || defined(__FreeBSD__) || defined(__DragonFly__)
 F(setpgid)
 F(getpgid)
 D(timezone)
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
 D(altzone)
 D(daylight)
 #endif
Index: src/runtime/x86-arch.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-arch.c,v
retrieving revision 1.30
diff -u -p -r1.30 x86-arch.c
--- src/runtime/x86-arch.c	14 Jul 2005 15:41:21 -0000	1.30
+++ src/runtime/x86-arch.c	20 Jul 2005 15:05:32 -0000
@@ -53,7 +53,7 @@ context_eflags_addr(os_context_t *contex
      * we need to do this nasty absolute index magic number thing
      * instead. */
     return &context->uc_mcontext.gregs[16];
-#elif defined __FreeBSD__
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
     return &context->uc_mcontext.mc_eflags;
 #elif defined __OpenBSD__
     return &context->sc_eflags;
Index: src/runtime/x86-assem.S
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-assem.S,v
retrieving revision 1.21
diff -u -p -r1.21 x86-assem.S
--- src/runtime/x86-assem.S	8 Jun 2005 08:49:52 -0000	1.21
+++ src/runtime/x86-assem.S	20 Jul 2005 15:05:32 -0000
@@ -29,7 +29,7 @@
  * turns out not to matter, perhaps it's just clutter we could get
  * rid of? -- WHN 2004-04-18)
  */
-#if defined __linux__  || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
+#if defined __linux__  || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __DragonFly__
 #define GNAME(var) var
 #else
 #define GNAME(var) _##var
@@ -44,7 +44,7 @@
  * matter any more, perhaps it's just clutter we could get
  * rid of? -- WHN 2004-04-18)
  */
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined __DragonFly__
 #define align_4byte	4
 #define align_8byte	8
 #define align_16byte	16
Index: src/runtime/x86-bsd-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-bsd-os.c,v
retrieving revision 1.7
diff -u -p -r1.7 x86-bsd-os.c
--- src/runtime/x86-bsd-os.c	14 Jul 2005 15:41:21 -0000	1.7
+++ src/runtime/x86-bsd-os.c	20 Jul 2005 15:05:32 -0000
@@ -14,7 +14,7 @@
  * entails; unfortunately, currently the situation is worse, not
  * better, than in the above paragraph. */
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 int *
 os_context_register_addr(os_context_t *context, int offset)
 {
@@ -46,7 +46,7 @@ os_context_sp_addr(os_context_t *context
     return CONTEXT_ADDR_FROM_STEM(esp);
 }
 
-#endif /* __FreeBSD__ || __OpenBSD__ */
+#endif /* __FreeBSD__ || __OpenBSD__  || __DragonFly__ */
 
 #ifdef __NetBSD__
 int *
Index: src/runtime/x86-bsd-os.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-bsd-os.h,v
retrieving revision 1.4
diff -u -p -r1.4 x86-bsd-os.h
--- src/runtime/x86-bsd-os.h	8 Apr 2004 13:26:04 -0000	1.4
+++ src/runtime/x86-bsd-os.h	20 Jul 2005 15:05:32 -0000
@@ -9,7 +9,7 @@ static inline os_context_t *arch_os_get_
  * store signal context information, but at least they tend to use the
  * same stems to name the structure fields, so by using this macro we
  * can share a fair amount of code between different variants. */
-#if defined __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext.mc_ ## stem
 #elif defined __OpenBSD__
 #define CONTEXT_ADDR_FROM_STEM(stem) &context->sc_ ## stem
