… | |
… | |
324 | ctx->env[JB_SP] = (__uint64_t)STACK_ADJUST_PTR (sptr, ssize); |
324 | ctx->env[JB_SP] = (__uint64_t)STACK_ADJUST_PTR (sptr, ssize); |
325 | |
325 | |
326 | # elif CORO_ASM |
326 | # elif CORO_ASM |
327 | |
327 | |
328 | ctx->sp = (volatile void **)(ssize + (char *)sptr); |
328 | ctx->sp = (volatile void **)(ssize + (char *)sptr); |
|
|
329 | /* we try to allow for both functions with and without frame pointers */ |
329 | *--ctx->sp = (void *)coro_init; |
330 | *--ctx->sp = (void *)coro_init; |
330 | *--ctx->sp = (void *)coro_init; // this is needed when the prologue saves ebp |
331 | { |
331 | ctx->sp -= NUM_SAVED; |
332 | void **frame = ctx->sp - 1; |
|
|
333 | int i; |
|
|
334 | for (i = NUM_SAVED; i--; ) |
|
|
335 | *--ctx->sp = frame; |
|
|
336 | } |
332 | |
337 | |
333 | # endif |
338 | # endif |
334 | |
339 | |
335 | coro_transfer ((coro_context *)create_coro, (coro_context *)new_coro); |
340 | coro_transfer ((coro_context *)create_coro, (coro_context *)new_coro); |
336 | |
341 | |