...
Text file src/pkg/runtime/rt0_windows_amd64.s
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 #include "go_asm.h"
6 #include "go_tls.h"
7 #include "textflag.h"
8
9 TEXT _rt0_amd64_windows(SB),NOSPLIT,$-8
10 JMP _rt0_amd64(SB)
11
12 // When building with -buildmode=(c-shared or c-archive), this
13 // symbol is called. For dynamic libraries it is called when the
14 // library is loaded. For static libraries it is called when the
15 // final executable starts, during the C runtime initialization
16 // phase.
17 // Leave space for four pointers on the stack as required
18 // by the Windows amd64 calling convention.
19 TEXT _rt0_amd64_windows_lib(SB),NOSPLIT,$0x48
20 MOVQ BP, 0x20(SP)
21 MOVQ BX, 0x28(SP)
22 MOVQ AX, 0x30(SP)
23 MOVQ CX, 0x38(SP)
24 MOVQ DX, 0x40(SP)
25
26 // Create a new thread to do the runtime initialization and return.
27 MOVQ _cgo_sys_thread_create(SB), AX
28 MOVQ $_rt0_amd64_windows_lib_go(SB), CX
29 MOVQ $0, DX
30 CALL AX
31
32 MOVQ 0x20(SP), BP
33 MOVQ 0x28(SP), BX
34 MOVQ 0x30(SP), AX
35 MOVQ 0x38(SP), CX
36 MOVQ 0x40(SP), DX
37 RET
38
39 TEXT _rt0_amd64_windows_lib_go(SB),NOSPLIT,$0
40 MOVQ $0, DI
41 MOVQ $0, SI
42 MOVQ $runtime·rt0_go(SB), AX
43 JMP AX
View as plain text