--- libcoro/coro.c 2003/03/22 23:08:40 1.10 +++ libcoro/coro.c 2005/03/03 17:20:31 1.13 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 Marc Alexander Lehmann + * Copyright (c) 2001-2005 Marc Alexander Lehmann * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: @@ -165,8 +165,8 @@ # elif CORO_LOOSE setjmp (ctx->env); - ctx->env[7] = (int)((char *)sptr + ssize); - ctx->env[8] = (int)coro_init; + ctx->env[7] = (long)((char *)sptr + ssize); + ctx->env[8] = (long)coro_init; # elif CORO_LINUX @@ -182,6 +182,9 @@ #elif defined(__GNU_LIBRARY__) && defined(__i386__) ctx->env[0].__jmpbuf[0].__pc = (char *)coro_init; 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); #else #error "linux libc or architecture not supported" #endif