 M: ppc %set-alien-double swap 0 STFD ;
 
 : load-zone-ptr ( reg -- )
-    [ "nursery" f ] dip %load-dlsym ;
+    "nursery" f %alien-global ;
 
 : load-allot-ptr ( nursery-ptr allot-ptr -- )
     [ drop load-zone-ptr ] [ swap 4 LWZ ] 2bi ;

    #! Save Factor stack pointers in case the C code calls a
    #! callback which does a GC, which must reliably trace
    #! all roots.
    "stack_chain" f scratch-reg %load-dlsym
    scratch-reg scratch-reg 0 LWZ
    1 scratch-reg 0 STW
    ds-reg scratch-reg 8 STW
    rs-reg scratch-reg 12 STW ;

M: ppc %alien-invoke ( symbol dll -- )
    11 %load-dlsym 11 MTLR BLRL ;

M: ppc %alien-callback ( quot -- )
    3 swap %load-indirect "c_to_factor" f %alien-invoke ;

M: ppc %not     NOT ;

: %alien-invoke-tail ( func dll -- )
    [ scratch-reg ] 2dip %alien-global scratch-reg MTCTR BCTR ;

:: exchange-regs ( r1 r2 -- )
    scratch-reg r1 MR
