… | |
… | |
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 |
128 | #if CORO_WIN_TIB |
|
|
129 | "\tpush %fs:0x0\n" |
|
|
130 | "\tpush %fs:0x8\n" |
129 | "\tpush %fs:0xc\n" |
131 | "\tpush %fs:0xc\n" |
130 | "\tpush %fs:0x8\n" |
|
|
131 | "\tpush %fs:0x0\n" |
|
|
132 | #endif |
132 | #endif |
133 | "\tmov %rsp, (%rdi)\n" |
133 | "\tmov %rsp, (%rdi)\n" |
134 | "\tmov (%rsi), %rsp\n" |
134 | "\tmov (%rsi), %rsp\n" |
135 | #if CORO_WIN_TIB |
135 | #if CORO_WIN_TIB |
|
|
136 | "\tpop %fs:0xc\n" |
|
|
137 | "\tpop %fs:0x8\n" |
136 | "\tpop %fs:0x0\n" |
138 | "\tpop %fs:0x0\n" |
137 | "\tpop %fs:0x8\n" |
|
|
138 | "\tpop %fs:0xc\n" |
|
|
139 | #endif |
139 | #endif |
140 | "\tpop %r15\n" |
140 | "\tpop %r15\n" |
141 | "\tpop %r14\n" |
141 | "\tpop %r14\n" |
142 | "\tpop %r13\n" |
142 | "\tpop %r13\n" |
143 | "\tpop %r12\n" |
143 | "\tpop %r12\n" |
… | |
… | |
148 | "\tpush %ebp\n" |
148 | "\tpush %ebp\n" |
149 | "\tpush %ebx\n" |
149 | "\tpush %ebx\n" |
150 | "\tpush %esi\n" |
150 | "\tpush %esi\n" |
151 | "\tpush %edi\n" |
151 | "\tpush %edi\n" |
152 | #if CORO_WIN_TIB |
152 | #if CORO_WIN_TIB |
|
|
153 | "\tpush %fs:0\n" |
|
|
154 | "\tpush %fs:4\n" |
153 | "\tpush %fs:8\n" |
155 | "\tpush %fs:8\n" |
154 | "\tpush %fs:4\n" |
|
|
155 | "\tpush %fs:0\n" |
|
|
156 | #endif |
156 | #endif |
157 | "\tmov %esp, (%eax)\n" |
157 | "\tmov %esp, (%eax)\n" |
158 | "\tmov (%edx), %esp\n" |
158 | "\tmov (%edx), %esp\n" |
159 | #if CORO_WIN_TIB |
159 | #if CORO_WIN_TIB |
|
|
160 | "\tpop %fs:8\n" |
|
|
161 | "\tpop %fs:4\n" |
160 | "\tpop %fs:0\n" |
162 | "\tpop %fs:0\n" |
161 | "\tpop %fs:4\n" |
|
|
162 | "\tpop %fs:8\n" |
|
|
163 | #endif |
163 | #endif |
164 | "\tpop %edi\n" |
164 | "\tpop %edi\n" |
165 | "\tpop %esi\n" |
165 | "\tpop %esi\n" |
166 | "\tpop %ebx\n" |
166 | "\tpop %ebx\n" |
167 | "\tpop %ebp\n" |
167 | "\tpop %ebp\n" |
… | |
… | |
295 | # elif CORO_ASM |
295 | # elif CORO_ASM |
296 | |
296 | |
297 | ctx->sp = (void **)(ssize + (char *)sptr); |
297 | ctx->sp = (void **)(ssize + (char *)sptr); |
298 | *--ctx->sp = (void *)abort; /* needed for alignment only */ |
298 | *--ctx->sp = (void *)abort; /* needed for alignment only */ |
299 | *--ctx->sp = (void *)coro_init; |
299 | *--ctx->sp = (void *)coro_init; |
|
|
300 | |
|
|
301 | #if CORO_WIN_TIB |
|
|
302 | *--ctx->sp = 0; /* ExceptionList */ |
|
|
303 | *--ctx->sp = (char *)sptr + ssize; /* StackBase */ |
|
|
304 | *--ctx->sp = sptr; /* StackLimit */ |
|
|
305 | #endif |
|
|
306 | |
300 | ctx->sp -= NUM_SAVED; |
307 | ctx->sp -= NUM_SAVED; |
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 | |
308 | |
308 | # elif CORO_UCONTEXT |
309 | # elif CORO_UCONTEXT |
309 | |
310 | |
310 | getcontext (&(ctx->uc)); |
311 | getcontext (&(ctx->uc)); |
311 | |
312 | |