summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-10-30 09:44:31 +0000
committerroot <root>2008-10-30 09:44:31 +0000
commitcfa51abba5be174106e78ce7e91fd2cec736d1c3 (patch)
treeef3795359cd04e79ac7c36d0c7b8d31b9f4f2a52
parent7b00d0eb759b3e87828e70ded35e509aea699e0d (diff)
*** empty log message ***rel-4_802
-rw-r--r--coro.c9
-rw-r--r--coro.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/coro.c b/coro.c
index 20266e7..909f396 100644
--- a/coro.c
+++ b/coro.c
@@ -326,9 +326,14 @@ void coro_create (coro_context *ctx,
# elif CORO_ASM
ctx->sp = (volatile void **)(ssize + (char *)sptr);
+ /* we try to allow for both functions with and without frame pointers */
*--ctx->sp = (void *)coro_init;
- *--ctx->sp = (void *)coro_init; // this is needed when the prologue saves ebp
- ctx->sp -= NUM_SAVED;
+ {
+ void **frame = ctx->sp - 1;
+ int i;
+ for (i = NUM_SAVED; i--; )
+ *--ctx->sp = frame;
+ }
# endif
diff --git a/coro.h b/coro.h
index b48583f..2041d3b 100644
--- a/coro.h
+++ b/coro.h
@@ -55,6 +55,7 @@
* 2008-03-02 Switched to 2-clause BSD license with GPL exception.
* 2008-04-04 New (but highly unrecommended) pthreads backend.
* 2008-04-24 Reinstate CORO_LOSER (had wrong stack adjustments).
+ * 2008-10-30 Support assembly method on x86 with and without frame pointer.
*/
#ifndef CORO_H