Left: | ||
Right: |
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 #include "funcdata.h" | 6 #include "funcdata.h" |
7 #include "../../cmd/ld/textflag.h" | 7 #include "../../cmd/ld/textflag.h" |
8 | 8 |
9 // using frame size $-4 means do not save LR on stack. | 9 // using frame size $-4 means do not save LR on stack. |
10 TEXT _rt0_go(SB),NOSPLIT,$-4 | 10 TEXT _rt0_go(SB),NOSPLIT,$-4 |
(...skipping 22 matching lines...) Expand all Loading... | |
33 MOVW $(-8192+104)(R13), R0 | 33 MOVW $(-8192+104)(R13), R0 |
34 MOVW R0, g_stackguard(g) // (w 104b guard) | 34 MOVW R0, g_stackguard(g) // (w 104b guard) |
35 MOVW R0, g_stackguard0(g) | 35 MOVW R0, g_stackguard0(g) |
36 MOVW R13, g_stackbase(g) | 36 MOVW R13, g_stackbase(g) |
37 BL runtime·emptyfunc(SB) // fault if stack check is wrong | 37 BL runtime·emptyfunc(SB) // fault if stack check is wrong |
38 | 38 |
39 // if there is an _cgo_init, call it. | 39 // if there is an _cgo_init, call it. |
40 MOVW _cgo_init(SB), R4 | 40 MOVW _cgo_init(SB), R4 |
41 CMP $0, R4 | 41 CMP $0, R4 |
42 B.EQ nocgo | 42 B.EQ nocgo |
43 MRC 15, 0, R0, C13, C0, 3 // load TLS base pointer | |
44 MOVW R0, R3 // arg 3: TLS base pointer | |
45 MOVW $runtime·tlsg(SB), R2 // arg 2: tlsg | |
46 MOVW $setg_gcc<>(SB), R1 // arg 1: setg | |
43 MOVW g, R0 // arg 0: G | 47 MOVW g, R0 // arg 0: G |
dfc
2014/07/02 04:33:05
if you're going to inline setg_gcc, please retain
crawshaw
2014/07/02 14:57:22
sorry, which comment?
| |
44 MOVW $setg_gcc<>(SB), R1 // arg 1: setg | |
45 MOVW.NE $runtime·tlsg(SB), R2 // arg 2: tlsg | |
minux
2014/07/02 04:21:14
.NE is unnecessary here.
crawshaw
2014/07/02 14:57:22
Done.
| |
46 MRC 15, 0, R3, C13, C0, 3 // arg 3: TLS base pointer | |
minux
2014/07/02 04:21:14
because this instruction will be rewritten by the
crawshaw
2014/07/02 14:57:22
thank you, I have been testing exclusively with GO
| |
47 BL (R4) // will clobber R0-R3 | 48 BL (R4) // will clobber R0-R3 |
48 | 49 |
49 nocgo: | 50 nocgo: |
50 // update stackguard after _cgo_init | 51 // update stackguard after _cgo_init |
51 MOVW g_stackguard0(g), R0 | 52 MOVW g_stackguard0(g), R0 |
52 MOVW R0, g_stackguard(g) | 53 MOVW R0, g_stackguard(g) |
53 | 54 |
54 BL runtime·checkgoarm(SB) | 55 BL runtime·checkgoarm(SB) |
55 BL runtime·check(SB) | 56 BL runtime·check(SB) |
56 | 57 |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 MOVW.P R0, 4(R2) | 1176 MOVW.P R0, 4(R2) |
1176 MOVW.P 4(R1), R0 | 1177 MOVW.P 4(R1), R0 |
1177 MOVW.P R0, 4(R2) | 1178 MOVW.P R0, 4(R2) |
1178 MOVW.P 4(R1), R0 | 1179 MOVW.P 4(R1), R0 |
1179 MOVW.P R0, 4(R2) | 1180 MOVW.P R0, 4(R2) |
1180 MOVW.P 4(R1), R0 | 1181 MOVW.P 4(R1), R0 |
1181 MOVW.P R0, 4(R2) | 1182 MOVW.P R0, 4(R2) |
1182 MOVW.P 4(R1), R0 | 1183 MOVW.P 4(R1), R0 |
1183 MOVW.P R0, 4(R2) | 1184 MOVW.P R0, 4(R2) |
1184 RET | 1185 RET |
LEFT | RIGHT |