LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 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 "defs_GOOS_GOARCH.h" | |
6 #include "zasm_GOOS_GOARCH.h" | 5 #include "zasm_GOOS_GOARCH.h" |
7 | 6 |
8 // setldt(int entry, int address, int limit) | 7 // setldt(int entry, int address, int limit) |
9 TEXT runtime·setldt(SB),7,$0 | 8 TEXT runtime·setldt(SB),7,$0 |
10 RET | 9 RET |
11 | 10 |
12 TEXT runtime·open(SB),7,$0 | 11 TEXT runtime·open(SB),7,$0 |
13 MOVL $14, AX | 12 MOVL $14, AX |
14 INT $64 | 13 INT $64 |
15 RET | 14 RET |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 94 |
96 // set SP to be on the new child stack | 95 // set SP to be on the new child stack |
97 MOVL stack+8(SP), CX | 96 MOVL stack+8(SP), CX |
98 MOVL CX, SP | 97 MOVL CX, SP |
99 | 98 |
100 // Initialize m, g. | 99 // Initialize m, g. |
101 get_tls(AX) | 100 get_tls(AX) |
102 MOVL DX, g(AX) | 101 MOVL DX, g(AX) |
103 MOVL BX, m(AX) | 102 MOVL BX, m(AX) |
104 | 103 |
105 » // Initialize AX from _tos->pid | 104 » // Initialize AX from TOS struct. |
106 » MOVL» _tos(SB), AX | 105 » MOVL» procid(AX), AX |
107 » MOVL» tos_pid(AX), AX | |
108 MOVL AX, m_procid(BX) // save pid as m->procid | 106 MOVL AX, m_procid(BX) // save pid as m->procid |
109 ········ | 107 ········ |
110 CALL runtime·stackcheck(SB) // smashes AX, CX | 108 CALL runtime·stackcheck(SB) // smashes AX, CX |
111 ········ | 109 ········ |
112 MOVL 0(DX), DX // paranoia; check they are not nil | 110 MOVL 0(DX), DX // paranoia; check they are not nil |
113 MOVL 0(BX), BX | 111 MOVL 0(BX), BX |
114 ········ | 112 ········ |
115 // more paranoia; check that stack splitting code works | 113 // more paranoia; check that stack splitting code works |
116 PUSHL SI | 114 PUSHL SI |
117 CALL runtime·emptyfunc(SB) | 115 CALL runtime·emptyfunc(SB) |
118 POPL SI | 116 POPL SI |
119 ········ | 117 ········ |
120 CALL SI // fn() | 118 CALL SI // fn() |
121 CALL runtime·exit(SB) | 119 CALL runtime·exit(SB) |
122 RET | 120 RET |
123 | 121 |
| 122 // void sigtramp(void *ureg, int8 *note) |
| 123 TEXT runtime·sigtramp(SB),7,$0 |
| 124 get_tls(AX) |
| 125 |
| 126 // check that m exists |
| 127 MOVL m(AX), BX |
| 128 CMPL BX, $0 |
| 129 JNE 3(PC) |
| 130 CALL runtime·badsignal(SB) // will exit |
| 131 RET |
| 132 |
| 133 // save args |
| 134 MOVL ureg+4(SP), CX |
| 135 MOVL note+8(SP), DX |
| 136 |
| 137 // change stack |
| 138 MOVL m_gsignal(BX), BP |
| 139 MOVL g_stackbase(BP), BP |
| 140 MOVL BP, SP |
| 141 |
| 142 // make room for args and g |
| 143 SUBL $16, SP |
| 144 |
| 145 // save g |
| 146 MOVL g(AX), BP |
| 147 MOVL BP, 12(SP) |
| 148 |
| 149 // g = m->gsignal |
| 150 MOVL m_gsignal(BX), DI |
| 151 MOVL DI, g(AX) |
| 152 |
| 153 // load args and call sighandler |
| 154 MOVL CX, 0(SP) |
| 155 MOVL DX, 4(SP) |
| 156 MOVL BP, 8(SP) |
| 157 |
| 158 CALL runtime·sighandler(SB) |
| 159 |
| 160 // restore g |
| 161 get_tls(BX) |
| 162 MOVL 12(SP), BP |
| 163 MOVL BP, g(BX) |
| 164 |
| 165 // call noted(AX) |
| 166 MOVL AX, 0(SP) |
| 167 CALL runtime·noted(SB) |
| 168 RET |
| 169 |
124 // Only used by the 64-bit runtime. | 170 // Only used by the 64-bit runtime. |
125 TEXT runtime·setfpmasks(SB),7,$0 | 171 TEXT runtime·setfpmasks(SB),7,$0 |
126 RET | 172 RET |
LEFT | RIGHT |