LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "zasm_GOOS_GOARCH.h" | 5 #include "zasm_GOOS_GOARCH.h" |
6 | 6 |
7 // void runtime·asmstdcall(void *c); | 7 // void runtime·asmstdcall(void *c); |
8 TEXT runtime·asmstdcall(SB),7,$0 | 8 TEXT runtime·asmstdcall(SB),7,$0 |
9 MOVL c+0(FP), BX | 9 MOVL c+0(FP), BX |
10 | 10 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // set up SEH frame again | 184 // set up SEH frame again |
185 PUSHL $runtime·sigtramp(SB) | 185 PUSHL $runtime·sigtramp(SB) |
186 PUSHL 0(FS) | 186 PUSHL 0(FS) |
187 MOVL SP, 0(FS) | 187 MOVL SP, 0(FS) |
188 | 188 |
189 // determine index into runtime·cbctxts table | 189 // determine index into runtime·cbctxts table |
190 SUBL $runtime·callbackasm(SB), AX | 190 SUBL $runtime·callbackasm(SB), AX |
191 MOVL $0, DX | 191 MOVL $0, DX |
192 MOVL $5, BX // divide by 5 because each call instruction in runtime·
callbacks is 5 bytes long | 192 MOVL $5, BX // divide by 5 because each call instruction in runtime·
callbacks is 5 bytes long |
193 DIVL BX, | 193 DIVL BX, |
194 SUBL $1, AX | |
195 | 194 |
196 // find correspondent runtime·cbctxts table entry | 195 // find correspondent runtime·cbctxts table entry |
197 » MOVL» $4, BX | 196 » MOVL» runtime·cbctxts(SB), BX |
198 » MULL» BX | 197 » MOVL» -4(BX)(AX*4), BX |
199 » ADDL» runtime·cbctxts(SB), AX | |
200 » MOVL» (AX), BX | |
201 | 198 |
202 // extract callback context | 199 // extract callback context |
203 MOVL cbctxt_gobody(BX), AX | 200 MOVL cbctxt_gobody(BX), AX |
204 MOVL cbctxt_argsize(BX), DX | 201 MOVL cbctxt_argsize(BX), DX |
205 | 202 |
206 // preserve whatever's at the memory location that | 203 // preserve whatever's at the memory location that |
207 // the callback will use to store the return value | 204 // the callback will use to store the return value |
208 PUSHL 0(CX)(DX*1) | 205 PUSHL 0(CX)(DX*1) |
209 | 206 |
210 // extend argsize by size of return value | 207 // extend argsize by size of return value |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 MOVL BP, SP | 362 MOVL BP, SP |
366 RET | 363 RET |
367 | 364 |
368 // This function requires 4 bytes of stack, | 365 // This function requires 4 bytes of stack, |
369 // to simulate what calling NtWaitForSingleObject will use. | 366 // to simulate what calling NtWaitForSingleObject will use. |
370 // (It is just a CALL to the system call dispatch.) | 367 // (It is just a CALL to the system call dispatch.) |
371 // If the linker okays the call to checkstack4 (a NOSPLIT function) | 368 // If the linker okays the call to checkstack4 (a NOSPLIT function) |
372 // then the call to NtWaitForSingleObject is okay too. | 369 // then the call to NtWaitForSingleObject is okay too. |
373 TEXT checkstack4<>(SB),7,$4 | 370 TEXT checkstack4<>(SB),7,$4 |
374 RET | 371 RET |
LEFT | RIGHT |