LEFT | RIGHT |
(no file at all) | |
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 #include "../../cmd/ld/textflag.h" | 6 #include "../../cmd/ld/textflag.h" |
7 | 7 |
8 // void runtime·asmstdcall(void *c); | 8 // void runtime·asmstdcall(void *c); |
9 TEXT runtime·asmstdcall(SB),NOSPLIT,$0 | 9 TEXT runtime·asmstdcall(SB),NOSPLIT,$0 |
10 MOVL fn+0(FP), BX | 10 MOVL fn+0(FP), BX |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 MOVL err+0(FP), AX | 69 MOVL err+0(FP), AX |
70 MOVL AX, 0x34(FS) | 70 MOVL AX, 0x34(FS) |
71 RET | 71 RET |
72 | 72 |
73 // Called by Windows as a Vectored Exception Handler (VEH). | 73 // Called by Windows as a Vectored Exception Handler (VEH). |
74 // First argument is pointer to struct containing | 74 // First argument is pointer to struct containing |
75 // exception record and context pointers. | 75 // exception record and context pointers. |
76 // Return 0 for 'not handled', -1 for handled. | 76 // Return 0 for 'not handled', -1 for handled. |
77 TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 | 77 TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 |
78 MOVL ptrs+0(FP), CX | 78 MOVL ptrs+0(FP), CX |
79 » SUBL» $28, SP | 79 » SUBL» $32, SP |
80 | 80 |
81 // save callee-saved registers | 81 // save callee-saved registers |
82 » MOVL» BX, 12(SP) | 82 » MOVL» BX, 28(SP) |
83 MOVL BP, 16(SP) | 83 MOVL BP, 16(SP) |
84 MOVL SI, 20(SP) | 84 MOVL SI, 20(SP) |
85 MOVL DI, 24(SP) | 85 MOVL DI, 24(SP) |
86 | 86 |
87 MOVL 0(CX), BX // ExceptionRecord* | 87 MOVL 0(CX), BX // ExceptionRecord* |
88 MOVL 4(CX), CX // Context* | 88 MOVL 4(CX), CX // Context* |
89 | 89 |
90 // fetch g | 90 // fetch g |
91 get_tls(DX) | 91 get_tls(DX) |
92 CMPL DX, $0 | 92 CMPL DX, $0 |
93 JNE 3(PC) | 93 JNE 3(PC) |
94 MOVL $0, AX // continue | 94 MOVL $0, AX // continue |
95 JMP done | 95 JMP done |
96 MOVL g(DX), DX | 96 MOVL g(DX), DX |
97 CMPL DX, $0 | 97 CMPL DX, $0 |
98 JNE 2(PC) | 98 JNE 2(PC) |
99 CALL runtime·badsignal2(SB) | 99 CALL runtime·badsignal2(SB) |
100 // call sighandler(ExceptionRecord*, Context*, G*) | 100 // call sighandler(ExceptionRecord*, Context*, G*) |
101 MOVL BX, 0(SP) | 101 MOVL BX, 0(SP) |
102 MOVL CX, 4(SP) | 102 MOVL CX, 4(SP) |
103 MOVL DX, 8(SP) | 103 MOVL DX, 8(SP) |
104 CALL runtime·sighandler(SB) | 104 CALL runtime·sighandler(SB) |
105 // AX is set to report result back to Windows | 105 // AX is set to report result back to Windows |
| 106 MOVL 12(SP), AX |
106 | 107 |
107 done: | 108 done: |
108 // restore callee-saved registers | 109 // restore callee-saved registers |
109 MOVL 24(SP), DI | 110 MOVL 24(SP), DI |
110 MOVL 20(SP), SI | 111 MOVL 20(SP), SI |
111 MOVL 16(SP), BP | 112 MOVL 16(SP), BP |
112 » MOVL» 12(SP), BX | 113 » MOVL» 28(SP), BX |
113 | 114 |
114 » ADDL» $28, SP | 115 » ADDL» $32, SP |
115 // RET 4 (return and pop 4 bytes parameters) | 116 // RET 4 (return and pop 4 bytes parameters) |
116 BYTE $0xC2; WORD $4 | 117 BYTE $0xC2; WORD $4 |
117 RET // unreached; make assembler happy | 118 RET // unreached; make assembler happy |
118 | 119 |
119 TEXT runtime·ctrlhandler(SB),NOSPLIT,$0 | 120 TEXT runtime·ctrlhandler(SB),NOSPLIT,$0 |
120 PUSHL $runtime·ctrlhandler1(SB) | 121 PUSHL $runtime·ctrlhandler1(SB) |
121 CALL runtime·externalthreadhandler(SB) | 122 CALL runtime·externalthreadhandler(SB) |
122 MOVL 4(SP), CX | 123 MOVL 4(SP), CX |
123 ADDL $12, SP | 124 ADDL $12, SP |
124 JMP CX | 125 JMP CX |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 MOVL BX, lo-8(SP) | 358 MOVL BX, lo-8(SP) |
358 LEAL lo-8(SP), BX | 359 LEAL lo-8(SP), BX |
359 MOVL BX, ptime-12(SP) | 360 MOVL BX, ptime-12(SP) |
360 MOVL $0, alertable-16(SP) | 361 MOVL $0, alertable-16(SP) |
361 MOVL $-1, handle-20(SP) | 362 MOVL $-1, handle-20(SP) |
362 MOVL SP, BP | 363 MOVL SP, BP |
363 MOVL runtime·NtWaitForSingleObject(SB), AX | 364 MOVL runtime·NtWaitForSingleObject(SB), AX |
364 CALL AX | 365 CALL AX |
365 MOVL BP, SP | 366 MOVL BP, SP |
366 RET | 367 RET |
LEFT | RIGHT |