From b63f47f6cf006e6070c3dc094b33b1b5217d165a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 5 Sep 2005 22:13:05 +0000 Subject: *** empty log message *** --- coro.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'coro.c') 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 -- cgit v1.2.3