summaryrefslogtreecommitdiff
path: root/coro.c
diff options
context:
space:
mode:
authorroot <root>2008-11-07 16:39:35 +0000
committerroot <root>2008-11-07 16:39:35 +0000
commit2acf5e290a218cd52e9d97247eadcb08889e55e6 (patch)
treec94043d56e9316f31f1aa279b0507934f67eee05 /coro.c
parenta042ff836732d4714dbe4a84ef1fbc060ba870f2 (diff)
*** empty log message ***
Diffstat (limited to 'coro.c')
-rw-r--r--coro.c12
1 files changed, 6 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;