]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix windows/386 build
authorRuss Cox <rsc@golang.org>
Tue, 9 Sep 2014 21:12:05 +0000 (17:12 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 9 Sep 2014 21:12:05 +0000 (17:12 -0400)
The difference between the old and the new (from earlier) code
is that we set stackguard = stack.lo + StackGuard, while the old
code set stackguard = stack.lo. That 512 bytes appears to be
the difference between the profileloop function running and not running.

We don't know how big the system stack is, but it is likely MUCH bigger than 4k.
Give Go/C 8k.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/140440044

src/runtime/memclr_386.s
src/runtime/memclr_amd64.s
src/runtime/sys_windows_386.s

index 8b163923e9ad00b6cbc1a554b46d3f06edecedaf..1520aea2e0fbbb220f1b9836e5d3bdd7f95afa1b 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "textflag.h"
 
+// NOTE: Windows externalthreadhandler expects memclr to preserve DX.
+
 // void runtime·memclr(void*, uintptr)
 TEXT runtime·memclr(SB), NOSPLIT, $0-8
        MOVL    ptr+0(FP), DI
index 35b3b4beefb3d2f8ea5a66d730bdaa1fdf488971..94a2c7f2360dbf6ad45daf048d907fcdc00fddf9 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "textflag.h"
 
+// NOTE: Windows externalthreadhandler expects memclr to preserve DX.
+
 // void runtime·memclr(void*, uintptr)
 TEXT runtime·memclr(SB), NOSPLIT, $0-16
        MOVQ    ptr+0(FP), DI
index ebcfdf4e0da9b26e687b83741a2be310838f7d02..9b1fc7a20580e0779f24aa661777a7e6365796e8 100644 (file)
@@ -191,7 +191,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
        CALL    runtime·memclr(SB)     // smashes AX,BX,CX
        LEAL    g_end(SP), BX
        MOVL    BX, g_m(SP)
-       LEAL    -4096(SP), CX
+       LEAL    -8192(SP), CX
        MOVL    CX, (g_stack+stack_lo)(SP)
        ADDL    $const_StackGuard, CX
        MOVL    CX, g_stackguard0(SP)