1 | /* |
1 | /* |
2 | * Copyright (c) 2001-2008 Marc Alexander Lehmann <schmorp@schmorp.de> |
2 | * Copyright (c) 2001-2009 Marc Alexander Lehmann <schmorp@schmorp.de> |
3 | * |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without modifica- |
4 | * Redistribution and use in source and binary forms, with or without modifica- |
5 | * tion, are permitted provided that the following conditions are met: |
5 | * tion, are permitted provided that the following conditions are met: |
6 | * |
6 | * |
7 | * 1. Redistributions of source code must retain the above copyright notice, |
7 | * 1. Redistributions of source code must retain the above copyright notice, |
… | |
… | |
226 | |
226 | |
227 | coro_setjmp (ctx->env); |
227 | coro_setjmp (ctx->env); |
228 | #if __CYGWIN__ |
228 | #if __CYGWIN__ |
229 | ctx->env[7] = (long)((char *)sptr + ssize) - sizeof (long); |
229 | ctx->env[7] = (long)((char *)sptr + ssize) - sizeof (long); |
230 | ctx->env[8] = (long)coro_init; |
230 | ctx->env[8] = (long)coro_init; |
|
|
231 | #elif defined(__MINGW32__) |
|
|
232 | ctx->env[4] = (long)((char *)sptr + ssize) - sizeof (long); |
|
|
233 | ctx->env[5] = (long)coro_init; |
231 | #elif defined(_M_IX86) |
234 | #elif defined(_M_IX86) |
232 | ((_JUMP_BUFFER *)&ctx->env)->Eip = (long)coro_init; |
235 | ((_JUMP_BUFFER *)&ctx->env)->Eip = (long)coro_init; |
233 | ((_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); |
234 | #elif defined(_M_AMD64) |
237 | #elif defined(_M_AMD64) |
235 | ((_JUMP_BUFFER *)&ctx->env)->Rip = (__int64)coro_init; |
238 | ((_JUMP_BUFFER *)&ctx->env)->Rip = (__int64)coro_init; |