X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fppc%2Fc-call.lisp;h=be7be0eb8b1b26e343029ab5293cff10eaed68db;hb=3a0f3612dc2bbf3e4e8e7395bcbbf8cd1791b963;hp=a21879294b07e1226191e1046910dc7fb115b5ce;hpb=adeddfb8570bb924b4899679912b4629008b7566;p=sbcl.git diff --git a/src/compiler/ppc/c-call.lisp b/src/compiler/ppc/c-call.lisp index a218792..be7be0e 100644 --- a/src/compiler/ppc/c-call.lisp +++ b/src/compiler/ppc/c-call.lisp @@ -485,7 +485,27 @@ (inst lis reg high) (inst ori reg reg low)))) ;; Setup the args - (load-address-into arg1 (get-lisp-obj-address #'enter-alien-callback)) + + ;; CLH 2006/02/10 -Following JES' logic in + ;; x86-64/c-call.lisp, we need to access + ;; ENTER-ALIEN-CALLBACK through the symbol-value slot + ;; of SB-ALIEN::*ENTER-ALIEN-CALLBACK* to ensure that + ;; it works if GC moves ENTER-ALIEN-CALLBACK. + ;; + ;; old way: + ;; (load-address-into arg1 (get-lisp-obj-address #'enter-alien-callback)) + + ;; new way: + ;; (load-symbol arg1 'sb!alien::*enter-alien-callback*) + ;; + ;; whoops: can't use load-symbol here as null-tn might + ;; not be loaded with the proper value as we are + ;; coming in from C code. Use nil-value constant + ;; instead, following the logic in x86-64/c-call.lisp. + (load-address-into arg1 (+ nil-value (static-symbol-offset + 'sb!alien::*enter-alien-callback*))) + (loadw arg1 arg1 symbol-value-slot other-pointer-lowtag) + (inst li arg2 (fixnumize index)) (inst addi arg3 sp n-foreign-linkage-area-bytes) ;; FIXME: This was (- (* RETURN-AREA-SIZE N-WORD-BYTES)), while