From: Christophe Rhodes Date: Mon, 29 Mar 2004 10:36:30 +0000 (+0000) Subject: 0.8.9.6.netbsd.1: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=074ba0606c687dbca4afc99e8e72e6f1a4486d24;p=sbcl.git 0.8.9.6.netbsd.1: Merge patch (Perry Metzger sbcl-devel 2004-03-27) for partial NetBSD support (some work also due to Valtteri Vuorikoski) --- diff --git a/base-target-features.lisp-expr b/base-target-features.lisp-expr index 5b97f72..929fd8a 100644 --- a/base-target-features.lisp-expr +++ b/base-target-features.lisp-expr @@ -277,6 +277,7 @@ ;; particular version of BSD we're intended to run under.) ;; :freebsd = We're intended to run under FreeBSD. ;; :openbsd = We're intended to run under OpenBSD. + ;; :netbsd = We're intended to run under NetBSD. ;; :sunos = We're intended to run under Solaris user environment ;; with the SunOS kernel. ;; :osf1 = We're intended to run under Tru64 (aka Digital Unix diff --git a/make-config.sh b/make-config.sh index ff693d1..f26c251 100644 --- a/make-config.sh +++ b/make-config.sh @@ -129,6 +129,10 @@ case `uname` in sbcl_os="openbsd" ln -s Config.$sbcl_arch-openbsd Config ;; + NetBSD) + printf ' :netbsd' >> $ltf + ln -s Config.$sbcl_arch-netbsd Config + ;; *) echo unsupported BSD variant: `uname` exit 1 diff --git a/src/code/bsd-os.lisp b/src/code/bsd-os.lisp index 2e3771d..6a96ee9 100644 --- a/src/code/bsd-os.lisp +++ b/src/code/bsd-os.lisp @@ -17,6 +17,7 @@ (the string ; (to force error in case of unsupported BSD variant) #!+FreeBSD "FreeBSD" #!+OpenBSD "OpenBSD" + #!+NetBSD "NetBSD" #!+Darwin "Darwin")) (defvar *software-version* nil) diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp index cac9887..29d1d7a 100644 --- a/src/code/foreign.lisp +++ b/src/code/foreign.lisp @@ -52,7 +52,7 @@ ;;; On any OS where we don't support foreign object file loading, any ;;; query of a foreign symbol value is answered with "no definition ;;; known", i.e. NIL. -#-(or linux sunos FreeBSD OpenBSD darwin) +#-(or linux sunos FreeBSD OpenBSD NetBSD darwin) (defun get-dynamic-foreign-symbol-address (symbol) (declare (type simple-string symbol) (ignore symbol)) nil) @@ -62,7 +62,7 @@ ;;; work on any ELF system with dlopen(3) and dlsym(3) ;;; It also works on OpenBSD, which isn't ELF, but is otherwise modern ;;; enough to have a fairly well working dlopen/dlsym implementation. -#-(or linux sunos FreeBSD OpenBSD darwin) +#-(or linux sunos FreeBSD OpenBSD NetBSD darwin) (macrolet ((define-unsupported-fun (fun-name) `(defun ,fun-name (&rest rest) "unsupported on this system" @@ -70,7 +70,7 @@ (error 'unsupported-operator :name ',fun-name)))) (define-unsupported-fun load-1-foreign) (define-unsupported-fun load-foreign)) -#+(or linux sunos FreeBSD OpenBSD darwin) +#+(or linux sunos FreeBSD OpenBSD NetBSD darwin) (progn ;;; flags for dlopen() diff --git a/src/code/load.lisp b/src/code/load.lisp index 8562044..f7a45a6 100644 --- a/src/code/load.lisp +++ b/src/code/load.lisp @@ -401,7 +401,7 @@ ;;; code for foreign symbol lookup should be here. (defun find-foreign-symbol-in-table (name table) (let ((prefixes - #!+(or osf1 sunos linux freebsd darwin) #("" "ldso_stub__") + #!+(or osf1 sunos linux freebsd netbsd darwin) #("" "ldso_stub__") #!+openbsd #(""))) (declare (notinline some)) ; to suppress bug 117 bogowarning (some (lambda (prefix) diff --git a/src/code/unix.lisp b/src/code/unix.lisp index dd04eb0..74f98be 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -293,14 +293,14 @@ ;; 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 sunos osf1 darwin) (,stub,) - #!+(or linux openbsd freebsd sunos osf1 darwin) + #!-(or linux openbsd freebsd netbsd sunos osf1 darwin) (,stub,) + #!+(or linux openbsd freebsd netbsd sunos osf1 darwin) (or (newcharstar-string (alien-funcall (extern-alien "getcwd" (function (* char) (* char) size-t)) nil - #!+(or linux openbsd freebsd darwin) 0 + #!+(or linux openbsd freebsd netbsd darwin) 0 #!+(or sunos osf1) 1025)) (simple-perror "getcwd"))) diff --git a/src/runtime/bsd-os.h b/src/runtime/bsd-os.h index f7c3e1c..1722662 100644 --- a/src/runtime/bsd-os.h +++ b/src/runtime/bsd-os.h @@ -18,7 +18,11 @@ #include typedef caddr_t os_vm_address_t; +#ifdef __NetBSD__ +typedef vsize_t os_vm_size_t; +#else typedef vm_size_t os_vm_size_t; +#endif typedef off_t os_vm_offset_t; typedef int os_vm_prot_t; typedef int os_context_register_t; @@ -28,7 +32,7 @@ typedef int os_context_register_t; * Linux sigaltstack(2) */ typedef struct sigaltstack stack_t; #elif defined __FreeBSD__ -/* FreeBSD 4.6 already has stack_t defined. */ +/* FreeBSD 4.6 and NetBSD 1.6 already have stack_t defined. */ #endif #if defined __FreeBSD__ diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 2b56009..d0448fd 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -69,7 +69,7 @@ boolean interrupt_maybe_gc_int(int, siginfo_t *, 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__) +#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. * diff --git a/src/runtime/undefineds.h b/src/runtime/undefineds.h index 2ad75ce..15dd343 100644 --- a/src/runtime/undefineds.h +++ b/src/runtime/undefineds.h @@ -38,7 +38,8 @@ F(brk) #if defined(hpux) \ || defined(SVR4) \ || defined(__FreeBSD__) \ - || defined(__OpenBSD__) + || defined(__OpenBSD__) \ + || defined(__NetBSD__) F(cfgetospeed) F(cfsetospeed) F(cfgetispeed) @@ -152,7 +153,7 @@ F(sigreturn) #if !defined(SVR4) F(sigsetmask) #endif -#if !defined(SVR4) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if !defined(SVR4) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) F(sigstack) F(sigvec) #endif @@ -177,6 +178,7 @@ F(readdir) || defined(SVR4) \ || defined(__FreeBSD__) \ || defined(__OpenBSD__) \ + || defined(__NetBSD__) \ || defined(__linux__) F(tcgetattr) F(tcsetattr) @@ -194,7 +196,8 @@ F(umask) && !defined(parisc) \ && !defined(SOLARIS) \ && !defined(__OpenBSD__) \ - && !defined(__FreeBSD__) + && !defined(__FreeBSD__) \ + && !defined(__NetBSD__) F(umount) #endif F(unlink) @@ -204,7 +207,7 @@ F(utimes) #ifndef irix F(vfork) #endif -#if !defined(osf1) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if !defined(osf1) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) F(vhangup) #endif F(wait) diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index 543c7e0..e5b26a7 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__ +#elif defined __OpenBSD__ || defined __NetBSD__ return &context->sc_eflags; #else #error unsupported OS diff --git a/src/runtime/x86-assem.S b/src/runtime/x86-assem.S index f5c6b63..1a135be 100644 --- a/src/runtime/x86-assem.S +++ b/src/runtime/x86-assem.S @@ -23,15 +23,15 @@ #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 diff --git a/tools-for-build/grovel-headers.c b/tools-for-build/grovel-headers.c index ff81d11..a494380 100644 --- a/tools-for-build/grovel-headers.c +++ b/tools-for-build/grovel-headers.c @@ -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); diff --git a/version.lisp-expr b/version.lisp-expr index 985be34..7213583 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.6" +"0.8.9.6.netbsd.1"