X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Fx86-64-assem.S;h=c654861cd30be40ff01372b9376b363b3c6fa61e;hb=310aee0b439b715a5ec242862ab0a4d254e123b5;hp=96429789ecf3bad17a5987f1c1c7c89ab4133a00;hpb=1b83f8f5a9c75b01993eadbcd564a4dd2c349b5e;p=sbcl.git diff --git a/src/runtime/x86-64-assem.S b/src/runtime/x86-64-assem.S index 9642978..c654861 100644 --- a/src/runtime/x86-64-assem.S +++ b/src/runtime/x86-64-assem.S @@ -117,20 +117,26 @@ GNAME(call_into_lisp): mov %rsp,%rbp # Establish new frame. Lstack: /* FIXME x86 saves FPU state here */ - push %rbx - push %r12 - push %r13 - push %r14 - push %r15 - + push %rbx # these regs are callee-saved according to C + push %r12 # so must be preserved and restored when + push %r13 # the lisp function returns + push %r14 # + push %r15 # mov %rsp,%rbx # remember current stack push %rbx # Save entry stack on (maybe) new stack. - /* Establish Lisp args. */ - mov %rdi,%rax # lexenv? - mov %rsi,%rbx # address of arg vec - mov %rdx,%rcx # num args + push %rdi # args from C + push %rsi # + push %rdx # +#ifdef LISP_FEATURE_SB_THREAD + mov specials,%rdi + call pthread_getspecific + mov %rax,%r12 +#endif + pop %rcx # num args + pop %rbx # arg vector + pop %rax # function ptr/lexenv xor %rdx,%rdx # clear any descriptor registers xor %rdi,%rdi # that we can't be sure we'll @@ -328,10 +334,9 @@ GNAME(post_signal_tramp): popq %r8 popq %rdi popq %rsi - addq $8, %rsp - popq %rsp - popq %rdx + /* skip RBP and RSP */ popq %rbx + popq %rdx popq %rcx popq %rax popfq