From 1071bf1ca8292aeeef4a684d277f1e6b4693865a Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 5 Feb 2007 07:23:40 +0000 Subject: [PATCH] 1.0.2.11: NetBSD/PPC support (from Aymeric Vincent sbcl-devel 2007-01-18). --- NEWS | 1 + make-config.sh | 4 +++- src/code/ppc-vm.lisp | 5 +++-- src/compiler/ppc/parms.lisp | 17 +++++++++++++++++ src/runtime/ppc-arch.c | 6 ++++++ tests/.cvsignore | 2 ++ tools-for-build/ldso-stubs.lisp | 2 +- version.lisp-expr | 2 +- 8 files changed, 34 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index f04d2857a..9d83d31b9 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-1.0.3 relative to sbcl-1.0.2: + * new platform: NetBSD/PPC. (thanks to Aymeric Vincent) * optimization: calls of the form (AREF FOO (+ INDEX )) now produce more efficient code on the x86 if the compiler can determine that (+ INDEX ) does not require a bounds check and FOO diff --git a/make-config.sh b/make-config.sh index e7657f00f..e5fbade2c 100644 --- a/make-config.sh +++ b/make-config.sh @@ -106,7 +106,7 @@ case `uname -m` in [Aa]lpha) guessed_sbcl_arch=alpha ;; sparc*) guessed_sbcl_arch=sparc ;; sun*) guessed_sbcl_arch=sparc ;; - ppc) guessed_sbcl_arch=ppc ;; + *ppc) guessed_sbcl_arch=ppc ;; ppc64) guessed_sbcl_arch=ppc ;; Power*Macintosh) guessed_sbcl_arch=ppc ;; parisc) guessed_sbcl_arch=hppa ;; @@ -313,6 +313,8 @@ elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "darwin" ]; then echo "See the limit(1) or ulimit(1) commands and the README file." exit 1 fi +elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "netbsd" ]; then + printf ' :gencgc :stack-allocatable-closures :linkage-table' >> $ltf elif [ "$sbcl_arch" = "sparc" ]; then # Test the compiler in order to see if we are building on Sun # toolchain as opposed to GNU binutils, and write the appropriate diff --git a/src/code/ppc-vm.lisp b/src/code/ppc-vm.lisp index c5f7b19b4..52cfe551f 100644 --- a/src/code/ppc-vm.lisp +++ b/src/code/ppc-vm.lisp @@ -120,8 +120,9 @@ ;;; Given a signal context, return the floating point modes word in ;;; the same format as returned by FLOATING-POINT-MODES. ;;; -;;; FIXME: surely this must be accessible somewhere under Darwin? -#!-darwin +;;; FIXME: surely this must be accessible somewhere under Darwin? Or +;;; under NetBSD? +#!+linux (define-alien-routine ("os_context_fp_control" context-floating-point-modes) (sb!alien:unsigned 32) (context (* os-context-t))) diff --git a/src/compiler/ppc/parms.lisp b/src/compiler/ppc/parms.lisp index 49dd23c67..69809f3e4 100644 --- a/src/compiler/ppc/parms.lisp +++ b/src/compiler/ppc/parms.lisp @@ -110,6 +110,23 @@ (def!constant linkage-table-space-end #x0b000000) (def!constant linkage-table-entry-size 16)) +#!+netbsd +(progn + #!+gencgc + (progn + (def!constant dynamic-space-start #x4f000000) + (def!constant dynamic-space-end #x7efff000)) + #!-gencgc + (progn + (def!constant dynamic-0-space-start #x4f000000) + (def!constant dynamic-0-space-end #x66fff000) + (def!constant dynamic-1-space-start #x67000000) + (def!constant dynamic-1-space-end #x7efff000)) + + (def!constant linkage-table-space-start #x0a000000) + (def!constant linkage-table-space-end #x0b000000) + (def!constant linkage-table-entry-size 16)) + #!+darwin (progn #!+gencgc diff --git a/src/runtime/ppc-arch.c b/src/runtime/ppc-arch.c index 03e0891bf..ac6b3d9aa 100644 --- a/src/runtime/ppc-arch.c +++ b/src/runtime/ppc-arch.c @@ -27,6 +27,7 @@ Caveat callers. */ +#if defined (LISP_FEATURE_DARWIN) || defined(LISP_FEATURE_LINUX) #ifndef PT_DAR #define PT_DAR 41 #endif @@ -34,6 +35,7 @@ #ifndef PT_DSISR #define PT_DSISR 42 #endif +#endif void arch_init() { } @@ -44,7 +46,11 @@ arch_get_bad_addr(int sig, siginfo_t *code, os_context_t *context) unsigned long pc = (unsigned long)(*os_context_pc_addr(context)); os_vm_address_t addr; +#if defined(LISP_FEATURE_NETBSD) + addr = (os_vm_address_t) (code->si_addr); +#else addr = (os_vm_address_t) (*os_context_register_addr(context,PT_DAR)); +#endif return addr; } diff --git a/tests/.cvsignore b/tests/.cvsignore index cf2206388..c08e8f533 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -4,3 +4,5 @@ stack-alignment-offset test-status.lisp-expr run-program-ed-test.tmp threads-foreign.c +read-sequence.data +write-sequence.data diff --git a/tools-for-build/ldso-stubs.lisp b/tools-for-build/ldso-stubs.lisp index a361f68ae..8e0310020 100644 --- a/tools-for-build/ldso-stubs.lisp +++ b/tools-for-build/ldso-stubs.lisp @@ -85,7 +85,7 @@ ldso_stub__ ## fct: ; \\ .L ## fct ## e1: ; \\ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;" -#!+(and linux ppc) " +#!+(and (not darwin) ppc) " #define LDSO_STUBIFY(fct) \\ .globl ldso_stub__ ## fct ; \\ .type ldso_stub__ ## fct,@function ; \\ diff --git a/version.lisp-expr b/version.lisp-expr index 4d4f2e633..8d7175e91 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".) -"1.0.2.10" +"1.0.2.11"