summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2005-09-05 22:13:05 +0000
committerroot <root>2005-09-05 22:13:05 +0000
commitb63f47f6cf006e6070c3dc094b33b1b5217d165a (patch)
tree3001da963ccfff61951749b4d6aff2acfe94fc37
parentba0f66be96eb012c722b6b3f448204ac8fdfc703 (diff)
*** empty log message ***rel-1_4
-rw-r--r--coro.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/coro.c b/coro.c
index 68a52d0..d0f7dee 100644
--- a/coro.c
+++ b/coro.c
@@ -40,6 +40,9 @@
# elif __i386__ && CORO_LINUX
# define STACK_ADJUST_PTR(sp,ss) ((char *)(sp) + (ss))
# define STACK_ADJUST_SIZE(sp,ss) (ss)
+# elif __amd64__ && CORO_LINUX
+# define STACK_ADJUST_PTR(sp,ss) ((char *)(sp) + (ss) - 8)
+# define STACK_ADJUST_SIZE(sp,ss) (ss)
# else
# define STACK_ADJUST_PTR(sp,ss) (sp)
# define STACK_ADJUST_SIZE(sp,ss) (ss)
@@ -190,7 +193,7 @@ void coro_create(coro_context *ctx,
ctx->env[0].__jmpbuf[0].__sp = (void *)((char *)sptr + ssize);
#elif defined(__GNU_LIBRARY__) && defined(__amd64__)
ctx->env[0].__jmpbuf[JB_PC] = (long)coro_init;
- ctx->env[0].__jmpbuf[JB_RSP] = (long)((char *)sptr + ssize);
+ ctx->env[0].__jmpbuf[JB_RSP] = (long)STACK_ADJUST_PTR (sptr,ssize);
#else
#error "linux libc or architecture not supported"
#endif