From: Daniel Barlow Date: Fri, 4 Apr 2003 14:46:18 +0000 (+0000) Subject: 0.pre8.34 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c10e4afc31e25003cc2500803ceb7589232e7f6b;p=sbcl.git 0.pre8.34 === Threads merge, 1.5625 metres === Reimplement CURRENT-THREAD-OFFSET-SAP using aliens on non-x86 targets - should make other non-x86 targets easier to fix. Immediate effect is that control stack exhaustion checking now works on PPC. --- diff --git a/src/code/target-unithread.lisp b/src/code/target-unithread.lisp index c79c011..e7a1917 100644 --- a/src/code/target-unithread.lisp +++ b/src/code/target-unithread.lisp @@ -1,5 +1,11 @@ (in-package "SB!THREAD") +#-sb-fluid (declaim (inline sb!vm::current-thread-offset-sap)) +(defun sb!vm::current-thread-offset-sap (n) + (declare (type (unsigned-byte 27) n)) + (sb!sys:sap-ref-sap (alien-sap (extern-alien "all_threads" (* t))) + (* n 4))) + (defun current-thread-id () (sb!sys:sap-int (sb!vm::current-thread-offset-sap sb!vm::thread-pid-slot))) diff --git a/src/compiler/ppc/system.lisp b/src/compiler/ppc/system.lisp index 3366e10..23f7a25 100644 --- a/src/compiler/ppc/system.lisp +++ b/src/compiler/ppc/system.lisp @@ -213,23 +213,6 @@ (:generator 1 (inst unimp pending-interrupt-trap))) -(defknown current-thread-offset-sap ((unsigned-byte 32)) - system-area-pointer (flushable)) - -(define-vop (current-thread-offset-sap) - (:results (sap :scs (sap-reg))) - (:result-types system-area-pointer) - (:translate current-thread-offset-sap) - (:args (n :scs (unsigned-reg) )) - (:temporary (:sc unsigned-reg :target sap) temp1) - (:temporary (:sc unsigned-reg) temp2) - (:arg-types unsigned-num) - (:policy :fast-safe) - (:generator 3 - (inst slwi n temp1 2) - (inst lr temp2 (make-fixup (extern-alien-name "all_threads") :foreign)) - (inst lwzx sap temp1 temp2))) - (define-vop (halt) (:generator 1 (inst unimp halt-trap))) diff --git a/src/compiler/x86/system.lisp b/src/compiler/x86/system.lisp index 803c580..4291164 100644 --- a/src/compiler/x86/system.lisp +++ b/src/compiler/x86/system.lisp @@ -274,25 +274,21 @@ (:generator 1 (inst break pending-interrupt-trap))) +#!+sb-thread (defknown current-thread-offset-sap ((unsigned-byte 32)) system-area-pointer (flushable)) +#!+sb-thread (define-vop (current-thread-offset-sap) (:results (sap :scs (sap-reg))) (:result-types system-area-pointer) (:translate current-thread-offset-sap) - (:args (n :scs (unsigned-reg) #!+sb-thread :target #!+sb-thread sap)) - #!-sb-thread (:temporary (:sc unsigned-reg :target sap) temp) + (:args (n :scs (unsigned-reg) :target sap)) (:arg-types unsigned-num) (:policy :fast-safe) - #!+sb-thread (:generator 2 (inst fs-segment-prefix) - (inst mov sap (make-ea :dword :disp 0 :index n :scale 4))) - #!-sb-thread - (:generator 2 - (inst mov temp (make-fixup (extern-alien-name "all_threads") :foreign)) - (inst mov sap (make-ea :dword :base temp :index n :scale 4)))) + (inst mov sap (make-ea :dword :disp 0 :index n :scale 4)))) (define-vop (halt) (:generator 1 diff --git a/version.lisp-expr b/version.lisp-expr index 3571f6a..b4b6ca1 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.37" +"0.pre8.38"