From 2acf5e290a218cd52e9d97247eadcb08889e55e6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Nov 2008 16:39:35 +0000 Subject: *** empty log message *** --- coro.c | 12 ++++++------ coro.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/coro.c b/coro.c index 3d47768..bc382d3 100644 --- a/coro.c +++ b/coro.c @@ -128,8 +128,8 @@ asm ( ".type coro_transfer, @function\n" "coro_transfer:\n" #if __amd64 -# define NUM_ALIGN 1 -# define NUM_SAVED 5 +# define NUM_SAVED 6 + "\tpush %rbp\n" "\tpush %rbx\n" "\tpush %r12\n" "\tpush %r13\n" @@ -142,19 +142,19 @@ asm ( "\tpop %r13\n" "\tpop %r12\n" "\tpop %rbx\n" + "\tpop %rbp\n" #elif __i386 -# define NUM_ALIGN 1 # define NUM_SAVED 4 + "\tpush %ebp\n" "\tpush %ebx\n" "\tpush %esi\n" "\tpush %edi\n" - "\tpush %ebp\n" "\tmov %esp, (%eax)\n" "\tmov (%edx), %esp\n" - "\tpop %ebp\n" "\tpop %edi\n" "\tpop %esi\n" "\tpop %ebx\n" + "\tpop %ebp\n" #else # error unsupported architecture #endif @@ -329,7 +329,7 @@ void coro_create (coro_context *ctx, # elif CORO_ASM ctx->sp = (volatile void **)(ssize + (char *)sptr); - ctx->sp -= NUM_ALIGN; + *--ctx->sp = (void *)abort; /* needed for alignment only */ *--ctx->sp = (void *)coro_init; ctx->sp -= NUM_SAVED; diff --git a/coro.h b/coro.h index 19dc3a0..3fdd555 100644 --- a/coro.h +++ b/coro.h @@ -58,6 +58,7 @@ * 2008-10-30 Support assembly method on x86 with and without frame pointer. * 2008-11-03 Use a global asm statement for CORO_ASM, idea by pippijn. * 2008-11-05 Hopefully fix misaligned stacks with CORO_ASM/SETJMP. + * 2008-11-07 rbp wasn't saved in CORO_ASM on x86_64. */ #ifndef CORO_H -- cgit v1.2.3