From 152ba31a2cccde6902106a2082a569f9ad83c43b Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Sun, 8 Aug 2010 01:11:55 +0000 Subject: [PATCH] 1.0.41.32: ppc: Random small threading bits. * Thread-specific static symbols (these should probably be moved to the list of common static symbols). * The reader for random TLS data, current-thread-offset-sap. * On threaded targets, stepping is controlled by a slot in the thread structure, not by a static-symbol. Fixed. * On non-threaded targets, don't hit the static-symbol value with yet another ad-hoc method of calculating the address, use the existing load-symbol-value macro. --- src/compiler/ppc/call.lisp | 20 ++++++++------------ src/compiler/ppc/parms.lisp | 5 +++++ src/compiler/ppc/system.lisp | 16 ++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/compiler/ppc/call.lisp b/src/compiler/ppc/call.lisp index dd68db8..4029d78 100644 --- a/src/compiler/ppc/call.lisp +++ b/src/compiler/ppc/call.lisp @@ -750,12 +750,10 @@ default-value-8 ;; Conditionally insert a conditional trap: (when step-instrumenting ;; Get the symbol-value of SB!IMPL::*STEPPING* - (loadw stepping - null-tn - (+ symbol-value-slot - (truncate (static-symbol-offset 'sb!impl::*stepping*) - n-word-bytes)) - other-pointer-lowtag) + #!-sb-thread + (load-symbol-value stepping sb!impl::*stepping*) + #!+sb-thread + (loadw stepping thread-base-tn thread-stepping-slot) (inst cmpw stepping null-tn) ;; If it's not null, trap. (inst beq step-done-label) @@ -1239,12 +1237,10 @@ default-value-8 (:vop-var vop) (:generator 3 ;; Get the symbol-value of SB!IMPL::*STEPPING* - (loadw stepping - null-tn - (+ symbol-value-slot - (truncate (static-symbol-offset 'sb!impl::*stepping*) - n-word-bytes)) - other-pointer-lowtag) + #!-sb-thread + (load-symbol-value stepping sb!impl::*stepping*) + #!+sb-thread + (loadw stepping thread-base-tn thread-stepping-slot) (inst cmpw stepping null-tn) ;; If it's not null, trap. (inst beq DONE) diff --git a/src/compiler/ppc/parms.lisp b/src/compiler/ppc/parms.lisp index f03c325..f856ae8 100644 --- a/src/compiler/ppc/parms.lisp +++ b/src/compiler/ppc/parms.lisp @@ -207,6 +207,11 @@ '( #!+gencgc *restart-lisp-function* + ;; Swiped from x86-64 thread implementation. + #!+sb-thread *stop-for-gc-pending* + #!+sb-thread *free-tls-index* + #!+sb-thread *tls-index-lock* + ;; CLH: 20060210 Taken from x86-64/parms.lisp per JES' suggestion ;; Needed for callbacks to work across saving cores. see ;; ALIEN-CALLBACK-ASSEMBLER-WRAPPER in c-call.lisp for gory diff --git a/src/compiler/ppc/system.lisp b/src/compiler/ppc/system.lisp index 678b682..684bf3c 100644 --- a/src/compiler/ppc/system.lisp +++ b/src/compiler/ppc/system.lisp @@ -217,6 +217,22 @@ (:generator 1 (inst unimp pending-interrupt-trap))) +#!+sb-thread +(defknown current-thread-offset-sap ((unsigned-byte 64)) + 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) :target sap)) + (:arg-types unsigned-num) + (:policy :fast-safe) + (:generator 2 + (inst slwi n n word-shift) + (inst lwzx sap thread-base-tn n))) + (define-vop (halt) (:generator 1 (inst unimp halt-trap))) diff --git a/version.lisp-expr b/version.lisp-expr index 704a9c1..1e59a8f 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.41.31" +"1.0.41.32" -- 1.7.10.4