aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_windows_amd64.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-05-25 20:01:25 -0400
committerRuss Cox <rsc@golang.org>2016-05-26 13:53:01 +0000
commitd9557523c2febc29ad3ecab8b1a4358abd709b30 (patch)
tree5abcaedb674cfde39c366d84d3ef214d2dd51d58 /src/runtime/sys_windows_amd64.s
parent805eaeef33a52778ba6ee624389c2cbfe6896f6f (diff)
downloadgo-d9557523c2febc29ad3ecab8b1a4358abd709b30.tar.xz
runtime: make framepointer mode safe for Windows
A few other architectures have already defined a NOFRAME flag. Use it to disable frame pointer code on a few very low-level functions that must behave like Windows code. Makes the failing os/signal test pass on a Windows gomote. Change-Id: I982365f2c59a0aa302b4428c970846c61027cf3e Reviewed-on: https://go-review.googlesource.com/23456 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/sys_windows_amd64.s')
-rw-r--r--src/runtime/sys_windows_amd64.s26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s
index d550a818ce..9c197379fb 100644
--- a/src/runtime/sys_windows_amd64.s
+++ b/src/runtime/sys_windows_amd64.s
@@ -11,7 +11,7 @@
#define maxargs 16
// void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall(SB),NOSPLIT,$0
+TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
// asmcgocall will put first argument into CX.
PUSHQ CX // save for later
MOVQ libcall_fn(CX), AX
@@ -62,7 +62,7 @@ loadregs:
RET
-TEXT runtime·badsignal2(SB),NOSPLIT,$48
+TEXT runtime·badsignal2(SB),NOSPLIT|NOFRAME,$48
// stderr
MOVQ $-12, CX // stderr
MOVQ CX, 0(SP)
@@ -102,7 +102,7 @@ TEXT runtime·setlasterror(SB),NOSPLIT,$0
// exception record and context pointers.
// Handler function is stored in AX.
// Return 0 for 'not handled', -1 for handled.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0-0
+TEXT runtime·sigtramp(SB),NOSPLIT|NOFRAME,$0-0
// CX: PEXCEPTION_POINTERS ExceptionInfo
// DI SI BP BX R12 R13 R14 R15 registers and DF flag are preserved
@@ -190,32 +190,32 @@ done:
RET
-TEXT runtime·exceptiontramp(SB),NOSPLIT,$0
+TEXT runtime·exceptiontramp(SB),NOSPLIT|NOFRAME,$0
MOVQ $runtime·exceptionhandler(SB), AX
JMP runtime·sigtramp(SB)
-TEXT runtime·firstcontinuetramp(SB),NOSPLIT,$0-0
+TEXT runtime·firstcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0
MOVQ $runtime·firstcontinuehandler(SB), AX
JMP runtime·sigtramp(SB)
-TEXT runtime·lastcontinuetramp(SB),NOSPLIT,$0-0
+TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0
MOVQ $runtime·lastcontinuehandler(SB), AX
JMP runtime·sigtramp(SB)
-TEXT runtime·ctrlhandler(SB),NOSPLIT,$8
+TEXT runtime·ctrlhandler(SB),NOSPLIT|NOFRAME,$8
MOVQ CX, 16(SP) // spill
MOVQ $runtime·ctrlhandler1(SB), CX
MOVQ CX, 0(SP)
CALL runtime·externalthreadhandler(SB)
RET
-TEXT runtime·profileloop(SB),NOSPLIT,$8
+TEXT runtime·profileloop(SB),NOSPLIT|NOFRAME,$8
MOVQ $runtime·profileloop1(SB), CX
MOVQ CX, 0(SP)
CALL runtime·externalthreadhandler(SB)
RET
-TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
+TEXT runtime·externalthreadhandler(SB),NOSPLIT|NOFRAME,$0
PUSHQ BP
MOVQ SP, BP
PUSHQ BX
@@ -228,7 +228,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
SUBQ $m__size, SP // space for M
MOVQ SP, 0(SP)
MOVQ $m__size, 8(SP)
- CALL runtime·memclr(SB) // smashes AX,BX,CX
+ CALL runtime·memclr(SB) // smashes AX,BX,CX, maybe BP
LEAQ m_tls(SP), CX
MOVQ CX, 0x28(GS)
@@ -239,7 +239,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
MOVQ SP, 0(SP)
MOVQ $g__size, 8(SP)
- CALL runtime·memclr(SB) // smashes AX,BX,CX
+ CALL runtime·memclr(SB) // smashes AX,BX,CX, maybe BP
LEAQ g__size(SP), BX
MOVQ BX, g_m(SP)
@@ -430,7 +430,7 @@ ret:
// Runs on OS stack. duration (in 100ns units) is in BX.
// The function leaves room for 4 syscall parameters
// (as per windows amd64 calling convention).
-TEXT runtime·usleep2(SB),NOSPLIT,$48
+TEXT runtime·usleep2(SB),NOSPLIT|NOFRAME,$48
MOVQ SP, AX
ANDQ $~15, SP // alignment as per Windows requirement
MOVQ AX, 40(SP)
@@ -446,7 +446,7 @@ TEXT runtime·usleep2(SB),NOSPLIT,$48
RET
// Runs on OS stack.
-TEXT runtime·switchtothread(SB),NOSPLIT,$0
+TEXT runtime·switchtothread(SB),NOSPLIT|NOFRAME,$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