1.0.41.32: ppc: Random small threading bits.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sun, 8 Aug 2010 01:11:55 +0000 (01:11 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sun, 8 Aug 2010 01:11:55 +0000 (01:11 +0000)
  * 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
src/compiler/ppc/parms.lisp
src/compiler/ppc/system.lisp
version.lisp-expr

index dd68db8..4029d78 100644 (file)
@@ -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)
index f03c325..f856ae8 100644 (file)
    '(
      #!+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
index 678b682..684bf3c 100644 (file)
   (: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)))
index 704a9c1..1e59a8f 100644 (file)
@@ -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"