#include "go_tls.h"
#include "textflag.h"
-TEXT _rt0_amd64_windows(SB),NOSPLIT,$-8
+TEXT _rt0_amd64_windows(SB),NOSPLIT|NOFRAME,$-8
JMP _rt0_amd64(SB)
// When building with -buildmode=(c-shared or c-archive), this
CALL AX
RET
-TEXT _rt0_amd64_windows_lib_go(SB),NOSPLIT,$0
+TEXT _rt0_amd64_windows_lib_go(SB),NOSPLIT|NOFRAME,$0
MOVQ $0, DI
MOVQ $0, SI
MOVQ $runtime·rt0_go(SB), AX
MOVD $runtime·rt0_go(SB), R2
B (R2)
-TEXT main(SB),NOSPLIT,$0
+TEXT main(SB),NOSPLIT|NOFRAME,$0
MOVD $runtime·rt0_go(SB), R2
B (R2)
MOVL AX, ret+0(FP)
RET
-TEXT runtime·sigFetchGSafe<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·sigFetchGSafe<ABIInternal>(SB),NOSPLIT,$0
get_tls(AX)
CMPL AX, $0
JE 2(PC)
// It switches stacks and jumps to the continuation address.
// DX and CX are set above at the end of sigtrampgo
// in the context that starts executing at sigresume.
-TEXT runtime·sigresume(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·sigresume(SB),NOSPLIT,$0
MOVL DX, SP
JMP CX
// This is called from rt0_go, which runs on the system stack
// using the initial stack allocated by the OS.
-TEXT runtime·wintls(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·wintls(SB),NOSPLIT,$0
// Allocate a TLS slot to hold g across calls to external code
MOVL SP, BP
MOVL runtime·_TlsAlloc(SB), AX
#define TEB_TlsSlots 0x1480
// void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
- // asmcgocall will put first argument into CX.
- PUSHQ CX // save for later
+TEXT runtime·asmstdcall(SB),NOSPLIT,$16
+ MOVQ SP, AX
+ ANDQ $~15, SP // alignment as per Windows requirement
+ MOVQ AX, 8(SP)
+ MOVQ CX, 0(SP) // asmcgocall will put first argument into CX.
+
MOVQ libcall_fn(CX), AX
MOVQ libcall_args(CX), SI
MOVQ libcall_n(CX), CX
ADDQ $(const_maxArgs*8), SP
// Return result.
- POPQ CX
+ MOVQ 0(SP), CX
+ MOVQ 8(SP), SP
MOVQ AX, libcall_r1(CX)
// Floating point return values are returned in XMM0. Setting r2 to this
// value in case this call returned a floating point value. For details,
// g may be nil.
// The function leaves room for 4 syscall parameters
// (as per windows amd64 calling convention).
-TEXT runtime·usleep2(SB),NOSPLIT|NOFRAME,$48-4
+TEXT runtime·usleep2(SB),NOSPLIT,$48-4
MOVLQSX dt+0(FP), BX
MOVQ SP, AX
ANDQ $~15, SP // alignment as per Windows requirement
// Runs on OS stack. duration (in -100ns units) is in dt+0(FP).
// g is valid.
-TEXT runtime·usleep2HighRes(SB),NOSPLIT|NOFRAME,$72-4
+TEXT runtime·usleep2HighRes(SB),NOSPLIT,$72-4
MOVLQSX dt+0(FP), BX
get_tls(CX)
RET
// Runs on OS stack.
-TEXT runtime·switchtothread(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·switchtothread(SB),NOSPLIT,$0
MOVQ SP, AX
ANDQ $~15, SP // alignment as per Windows requirement
SUBQ $(48), SP // room for SP and 4 args as per Windows requirement
// func osSetupTLS(mp *m)
// Setup TLS. for use by needm on Windows.
-TEXT runtime·osSetupTLS(SB),NOSPLIT|NOFRAME,$0-8
+TEXT runtime·osSetupTLS(SB),NOSPLIT,$0-8
MOVQ mp+0(FP), AX
LEAQ m_tls(AX), DI
CALL runtime·settls(SB)
// This is called from rt0_go, which runs on the system stack
// using the initial stack allocated by the OS.
-TEXT runtime·wintls(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·wintls(SB),NOSPLIT,$0
// Allocate a TLS slot to hold g across calls to external code
MOVQ SP, AX
ANDQ $~15, SP // alignment as per Windows requirement
B runtime·armPublicationBarrier(SB)
// never called (this is a GOARM=7 platform)
-TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·read_tls_fallback(SB),NOSPLIT,$0
MOVW $0xabcd, R0
MOVW R0, (R0)
RET
-TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8
+TEXT runtime·nanotime1(SB),NOSPLIT,$0-8
MOVW $0, R0
MOVB runtime·useQPCTime(SB), R0
CMP $0, R0
MOVW R4, ret_hi+4(FP)
RET
useQPC:
- B runtime·nanotimeQPC(SB) // tail call
+ RET runtime·nanotimeQPC(SB) // tail call
// save_g saves the g register (R10) into thread local memory
// so that we can call externally compiled
// Save the value in the _TEB->TlsSlots array.
// Effectively implements TlsSetValue().
// tls_g stores the TLS slot allocated TlsAlloc().
-TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·save_g(SB),NOSPLIT,$0
MRC 15, 0, R0, C13, C0, 2
ADD $0xe10, R0
MOVW $runtime·tls_g(SB), R11
// ARM code that overwrote those registers.
// Get the value from the _TEB->TlsSlots array.
// Effectively implements TlsGetValue().
-TEXT runtime·load_g(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·load_g(SB),NOSPLIT,$0
MRC 15, 0, R0, C13, C0, 2
ADD $0xe10, R0
MOVW $runtime·tls_g(SB), g
// load_g and save_g (in tls_arm64.s) clobber R27 (REGTMP) and R0.
// void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
- STP.W (R29, R30), -32(RSP) // allocate C ABI stack frame
+TEXT runtime·asmstdcall(SB),NOSPLIT,$16
STP (R19, R20), 16(RSP) // save old R19, R20
MOVD R0, R19 // save libcall pointer
MOVD RSP, R20 // save stack pointer
// Restore callee-saved registers.
LDP 16(RSP), (R19, R20)
- LDP.P 32(RSP), (R29, R30)
RET
-TEXT runtime·getlasterror(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·getlasterror(SB),NOSPLIT,$0
MOVD TEB_error(R18_PLATFORM), R0
MOVD R0, ret+0(FP)
RET
// duration (in -100ns units) is in dt+0(FP).
// g is valid.
// TODO: needs to be implemented properly.
-TEXT runtime·usleep2HighRes(SB),NOSPLIT,$0-4
+TEXT runtime·usleep2HighRes(SB),NOSPLIT|NOFRAME,$0-4
B runtime·abort(SB)
// Runs on OS stack.
ADD $16, RSP
RET
-TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8
+TEXT runtime·nanotime1(SB),NOSPLIT,$0-8
MOVB runtime·useQPCTime(SB), R0
CMP $0, R0
BNE useQPC
MOVD R0, ret+0(FP)
RET
useQPC:
- B runtime·nanotimeQPC(SB) // tail call
+ RET runtime·nanotimeQPC(SB) // tail call
// This is called from rt0_go, which runs on the system stack
// using the initial stack allocated by the OS.
#include "textflag.h"
#include "time_windows.h"
-TEXT time·now(SB),NOSPLIT|NOFRAME,$0-20
+TEXT time·now(SB),NOSPLIT,$0-20
MOVW $0, R0
MOVB runtime·useQPCTime(SB), R0
CMP $0, R0
MOVW R1,nsec+8(FP)
RET
useQPC:
- B runtime·nowQPC(SB) // tail call
+ RET runtime·nowQPC(SB) // tail call
#include "textflag.h"
#include "time_windows.h"
-TEXT time·now(SB),NOSPLIT|NOFRAME,$0-24
+TEXT time·now(SB),NOSPLIT,$0-24
MOVB runtime·useQPCTime(SB), R0
CMP $0, R0
BNE useQPC
MOVW R0, nsec+8(FP)
RET
useQPC:
- B runtime·nowQPC(SB) // tail call
+ RET runtime·nowQPC(SB) // tail call