summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-07-16 00:47:05 +0000
committerroot <root>2008-07-16 00:47:05 +0000
commit7b00d0eb759b3e87828e70ded35e509aea699e0d (patch)
treef77c4348ceacd73e42821709ce696ad472d4ba54
parentd248d11e3bb89a125e5e07b84460d637448667df (diff)
*** empty log message ***rel-4_8
-rw-r--r--coro.c8
-rw-r--r--coro.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/coro.c b/coro.c
index 55e9f73..20266e7 100644
--- a/coro.c
+++ b/coro.c
@@ -122,12 +122,12 @@ trampoline (int sig)
#endif
#if CORO_ASM
-void __attribute__((__noinline__, __fastcall__))
+void __attribute__((__noinline__, __regparm__(2)))
coro_transfer (struct coro_context *prev, struct coro_context *next)
{
asm volatile (
#if __amd64
-# define NUM_CLOBBERED 5
+# define NUM_SAVED 5
"push %%rbx\n\t"
"push %%r12\n\t"
"push %%r13\n\t"
@@ -141,7 +141,7 @@ coro_transfer (struct coro_context *prev, struct coro_context *next)
"pop %%r12\n\t"
"pop %%rbx\n\t"
#elif __i386
-# define NUM_CLOBBERED 4
+# define NUM_SAVED 4
"push %%ebx\n\t"
"push %%esi\n\t"
"push %%edi\n\t"
@@ -328,7 +328,7 @@ void coro_create (coro_context *ctx,
ctx->sp = (volatile void **)(ssize + (char *)sptr);
*--ctx->sp = (void *)coro_init;
*--ctx->sp = (void *)coro_init; // this is needed when the prologue saves ebp
- ctx->sp -= NUM_CLOBBERED;
+ ctx->sp -= NUM_SAVED;
# endif
diff --git a/coro.h b/coro.h
index 28fc40b..b48583f 100644
--- a/coro.h
+++ b/coro.h
@@ -210,7 +210,7 @@ struct coro_context {
volatile void **sp;
};
-void __attribute__ ((__noinline__, __fastcall__))
+void __attribute__ ((__noinline__, __regparm__(2)))
coro_transfer (coro_context *prev, coro_context *next);
#elif CORO_PTHREAD