Index: src/pkg/runtime/proc.c |
=================================================================== |
--- a/src/pkg/runtime/proc.c |
+++ b/src/pkg/runtime/proc.c |
@@ -601,14 +601,12 @@ |
void |
runtime·mstart(void) |
{ |
-#ifdef GOOS_windows |
-#ifdef GOARCH_386 |
+#ifdef GOOSARCH_windows_386 |
// It is used by windows-386 only. Unfortunately, seh needs |
// to be located on os stack, and mstart runs on os stack |
// for both m0 and m. |
SEH seh; |
#endif |
-#endif |
if(g != m->g0) |
runtime·throw("bad runtime·mstart"); |
@@ -619,11 +617,9 @@ |
runtime·gosave(&m->g0->sched); |
m->g0->sched.pc = (uintptr)-1; // make sure it is never used |
m->g0->stackguard = m->g0->stackguard0; // cgo sets only stackguard0, copy it to stackguard |
-#ifdef GOOS_windows |
-#ifdef GOARCH_386 |
+#ifdef GOOSARCH_windows_386 |
m->seh = &seh; |
#endif |
-#endif |
runtime·asminit(); |
runtime·minit(); |
@@ -775,15 +771,13 @@ |
g->stackguard = (uintptr)(&x - 32*1024); |
g->stackguard0 = g->stackguard; |
-#ifdef GOOS_windows |
-#ifdef GOARCH_386 |
+#ifdef GOOSARCH_windows_386 |
// On windows/386, we need to put an SEH frame (two words) |
// somewhere on the current stack. We are called from cgocallback_gofunc |
// and we know that it will leave two unused words below m->curg->sched.sp. |
// Use those. |
m->seh = (SEH*)((uintptr*)&x + 1); |
#endif |
-#endif |
// Initialize this thread to use the m. |
runtime·asminit(); |
@@ -862,11 +856,9 @@ |
// Undo whatever initialization minit did during needm. |
runtime·unminit(); |
-#ifdef GOOS_windows |
-#ifdef GOARCH_386 |
+#ifdef GOOSARCH_windows_386 |
m->seh = nil; // reset dangling typed pointer |
#endif |
-#endif |
// Clear m and g, and return m to the extra list. |
// After the call to setmg we can only call nosplit functions. |