… | |
… | |
123 | "\tpush %rbx\n" |
123 | "\tpush %rbx\n" |
124 | "\tpush %r12\n" |
124 | "\tpush %r12\n" |
125 | "\tpush %r13\n" |
125 | "\tpush %r13\n" |
126 | "\tpush %r14\n" |
126 | "\tpush %r14\n" |
127 | "\tpush %r15\n" |
127 | "\tpush %r15\n" |
|
|
128 | #if CORO_WIN_TIB |
|
|
129 | "\tpush %fs:0xc\n" |
|
|
130 | "\tpush %fs:0x8\n" |
|
|
131 | "\tpush %fs:0x0\n" |
|
|
132 | #endif |
128 | "\tmov %rsp, (%rdi)\n" |
133 | "\tmov %rsp, (%rdi)\n" |
129 | "\tmov (%rsi), %rsp\n" |
134 | "\tmov (%rsi), %rsp\n" |
|
|
135 | #if CORO_WIN_TIB |
|
|
136 | "\tpop %fs:0x0\n" |
|
|
137 | "\tpop %fs:0x8\n" |
|
|
138 | "\tpop %fs:0xc\n" |
|
|
139 | #endif |
130 | "\tpop %r15\n" |
140 | "\tpop %r15\n" |
131 | "\tpop %r14\n" |
141 | "\tpop %r14\n" |
132 | "\tpop %r13\n" |
142 | "\tpop %r13\n" |
133 | "\tpop %r12\n" |
143 | "\tpop %r12\n" |
134 | "\tpop %rbx\n" |
144 | "\tpop %rbx\n" |
… | |
… | |
137 | #define NUM_SAVED 4 |
147 | #define NUM_SAVED 4 |
138 | "\tpush %ebp\n" |
148 | "\tpush %ebp\n" |
139 | "\tpush %ebx\n" |
149 | "\tpush %ebx\n" |
140 | "\tpush %esi\n" |
150 | "\tpush %esi\n" |
141 | "\tpush %edi\n" |
151 | "\tpush %edi\n" |
|
|
152 | #if CORO_WIN_TIB |
|
|
153 | "\tpush %fs:8\n" |
|
|
154 | "\tpush %fs:4\n" |
|
|
155 | "\tpush %fs:0\n" |
|
|
156 | #endif |
142 | "\tmov %esp, (%eax)\n" |
157 | "\tmov %esp, (%eax)\n" |
143 | "\tmov (%edx), %esp\n" |
158 | "\tmov (%edx), %esp\n" |
|
|
159 | #if CORO_WIN_TIB |
|
|
160 | "\tpop %fs:0\n" |
|
|
161 | "\tpop %fs:4\n" |
|
|
162 | "\tpop %fs:8\n" |
|
|
163 | #endif |
144 | "\tpop %edi\n" |
164 | "\tpop %edi\n" |
145 | "\tpop %esi\n" |
165 | "\tpop %esi\n" |
146 | "\tpop %ebx\n" |
166 | "\tpop %ebx\n" |
147 | "\tpop %ebp\n" |
167 | "\tpop %ebp\n" |
148 | #else |
168 | #else |
… | |
… | |
277 | ctx->sp = (void **)(ssize + (char *)sptr); |
297 | ctx->sp = (void **)(ssize + (char *)sptr); |
278 | *--ctx->sp = (void *)abort; /* needed for alignment only */ |
298 | *--ctx->sp = (void *)abort; /* needed for alignment only */ |
279 | *--ctx->sp = (void *)coro_init; |
299 | *--ctx->sp = (void *)coro_init; |
280 | ctx->sp -= NUM_SAVED; |
300 | ctx->sp -= NUM_SAVED; |
281 | |
301 | |
|
|
302 | #if CORO_WIN_TIB |
|
|
303 | *--ctx->sp = sptr; /* StackLimit */ |
|
|
304 | *--ctx->sp = (char *)sptr + ssize; /* StackBase */ |
|
|
305 | *--ctx->sp = 0; /* ExceptionList */ |
|
|
306 | #endif |
|
|
307 | |
282 | # elif CORO_UCONTEXT |
308 | # elif CORO_UCONTEXT |
283 | |
309 | |
284 | getcontext (&(ctx->uc)); |
310 | getcontext (&(ctx->uc)); |
285 | |
311 | |
286 | ctx->uc.uc_link = 0; |
312 | ctx->uc.uc_link = 0; |