--- cvsroot/libcoro/coro.c 2001/09/03 02:50:18 1.5 +++ cvsroot/libcoro/coro.c 2001/09/03 03:42:13 1.7 @@ -32,15 +32,15 @@ #include "coro.h" -#if CORO_SJLJ || CORO_LOOSE || CORO_LINUX || CORO_IRIX - /* IRIX is decidedly NON-unix */ #if __sgi -# define STACK_ADJUST(sp,ss) ((ss) - sizeof (long) + (char *)(sp)) +# define STACK_ADJUST(sp,ss) ((char *)(sp) + (ss) - 8) #else -# define STACK_ADJUST(sp,ss) (ss) +# define STACK_ADJUST(sp,ss) (sp) #endif +#if CORO_SJLJ || CORO_LOOSE || CORO_LINUX || CORO_IRIX + #include static volatile coro_func coro_init_func; @@ -182,8 +182,8 @@ # elif CORO_IRIX setjmp (ctx->env); - ctx->env[JB_PC] = (int)coro_init; - ctx->env[JB_SP] = (int)((char *)sptr + ssize); + ctx->env[JB_PC] = (__uint64_t)coro_init; + ctx->env[JB_SP] = (__uint64_t)STACK_ADJUST(sptr,ssize); # endif