ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libcoro/coro.c
(Generate patch)

Comparing libcoro/coro.c (file contents):
Revision 1.46 by root, Sat Jul 11 14:24:13 2009 UTC vs.
Revision 1.47 by root, Fri Jul 17 14:05:00 2009 UTC

224 224
225# elif CORO_LOSER 225# elif CORO_LOSER
226 226
227 coro_setjmp (ctx->env); 227 coro_setjmp (ctx->env);
228 #if __CYGWIN__ 228 #if __CYGWIN__
229 ctx->env[8] = (long) coro_init;
229 ctx->env[7] = (long)((char *)sptr + ssize) - sizeof (long); 230 ctx->env[7] = (long) ((char *)sptr + ssize) - sizeof (long);
230 ctx->env[8] = (long)coro_init;
231 #elif defined(__MINGW32__) 231 #elif defined(__MINGW32__)
232 ctx->env[5] = (long) coro_init;
232 ctx->env[4] = (long)((char *)sptr + ssize) - sizeof (long); 233 ctx->env[4] = (long) ((char *)sptr + ssize) - sizeof (long);
233 ctx->env[5] = (long)coro_init;
234 #elif defined(_M_IX86) 234 #elif defined(_M_IX86)
235 ((_JUMP_BUFFER *)&ctx->env)->Eip = (long)coro_init; 235 ((_JUMP_BUFFER *)&ctx->env)->Eip = (long) coro_init;
236 ((_JUMP_BUFFER *)&ctx->env)->Esp = (long)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long); 236 ((_JUMP_BUFFER *)&ctx->env)->Esp = (long) STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
237 #elif defined(_M_AMD64) 237 #elif defined(_M_AMD64)
238 ((_JUMP_BUFFER *)&ctx->env)->Rip = (__int64)coro_init; 238 ((_JUMP_BUFFER *)&ctx->env)->Rip = (__int64) coro_init;
239 ((_JUMP_BUFFER *)&ctx->env)->Rsp = (__int64)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long); 239 ((_JUMP_BUFFER *)&ctx->env)->Rsp = (__int64) STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
240 #elif defined(_M_IA64) 240 #elif defined(_M_IA64)
241 ((_JUMP_BUFFER *)&ctx->env)->StIIP = (__int64)coro_init; 241 ((_JUMP_BUFFER *)&ctx->env)->StIIP = (__int64) coro_init;
242 ((_JUMP_BUFFER *)&ctx->env)->IntSp = (__int64)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long); 242 ((_JUMP_BUFFER *)&ctx->env)->IntSp = (__int64) STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
243 #else 243 #else
244 #error "microsoft libc or architecture not supported" 244 #error "microsoft libc or architecture not supported"
245 #endif 245 #endif
246 246
247# elif CORO_LINUX 247# elif CORO_LINUX
248 248
249 coro_setjmp (ctx->env); 249 coro_setjmp (ctx->env);
250 #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (JB_PC) && defined (JB_SP) 250 #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (JB_PC) && defined (JB_SP)
251 ctx->env[0].__jmpbuf[JB_PC] = (long)coro_init; 251 ctx->env[0].__jmpbuf[JB_PC] = (long) coro_init;
252 ctx->env[0].__jmpbuf[JB_SP] = (long)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long); 252 ctx->env[0].__jmpbuf[JB_SP] = (long) STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
253 #elif __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (__mc68000__) 253 #elif __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (__mc68000__)
254 ctx->env[0].__jmpbuf[0].__aregs[0] = (long int)coro_init; 254 ctx->env[0].__jmpbuf[0].__aregs[0] = (long int)coro_init;
255 ctx->env[0].__jmpbuf[0].__sp = (int *)((char *)sptr + ssize) - sizeof (long); 255 ctx->env[0].__jmpbuf[0].__sp = (int *) ((char *)sptr + ssize) - sizeof (long);
256 #elif defined (__GNU_LIBRARY__) && defined (__i386__) 256 #elif defined (__GNU_LIBRARY__) && defined (__i386__)
257 ctx->env[0].__jmpbuf[0].__pc = (char *)coro_init; 257 ctx->env[0].__jmpbuf[0].__pc = (char *) coro_init;
258 ctx->env[0].__jmpbuf[0].__sp = (void *)((char *)sptr + ssize) - sizeof (long); 258 ctx->env[0].__jmpbuf[0].__sp = (void *) ((char *)sptr + ssize) - sizeof (long);
259 #elif defined (__GNU_LIBRARY__) && defined (__amd64__) 259 #elif defined (__GNU_LIBRARY__) && defined (__amd64__)
260 ctx->env[0].__jmpbuf[JB_PC] = (long)coro_init; 260 ctx->env[0].__jmpbuf[JB_PC] = (long) coro_init;
261 ctx->env[0].__jmpbuf[0].__sp = (void *)((char *)sptr + ssize) - sizeof (long); 261 ctx->env[0].__jmpbuf[0].__sp = (void *) ((char *)sptr + ssize) - sizeof (long);
262 #else 262 #else
263 #error "linux libc or architecture not supported" 263 #error "linux libc or architecture not supported"
264 #endif 264 #endif
265 265
266# elif CORO_IRIX 266# elif CORO_IRIX
267 267
268 coro_setjmp (ctx->env, 0); 268 coro_setjmp (ctx->env, 0);
269 ctx->env[JB_PC] = (__uint64_t)coro_init; 269 ctx->env[JB_PC] = (__uint64_t)coro_init;
270 ctx->env[JB_SP] = (__uint64_t)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long); 270 ctx->env[JB_SP] = (__uint64_t)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
271 271
272# elif CORO_ASM 272# elif CORO_ASM
273 273
274 ctx->sp = (void **)(ssize + (char *)sptr); 274 ctx->sp = (void **)(ssize + (char *)sptr);
275 *--ctx->sp = (void *)abort; /* needed for alignment only */ 275 *--ctx->sp = (void *)abort; /* needed for alignment only */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines