From: Russ Cox Date: Thu, 19 Nov 2009 02:17:11 +0000 (-0800) Subject: runtime: fix bug on darwin/amd64 - bad g in bsdthread_start X-Git-Tag: weekly.2009-12-07~203 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e1c5c3df77302af0bbc85c9374add746099f6c24;p=gostls13.git runtime: fix bug on darwin/amd64 - bad g in bsdthread_start R=r https://golang.org/cl/157077 --- diff --git a/src/pkg/runtime/darwin/amd64/sys.s b/src/pkg/runtime/darwin/amd64/sys.s index c39c44a699..22a7c81973 100644 --- a/src/pkg/runtime/darwin/amd64/sys.s +++ b/src/pkg/runtime/darwin/amd64/sys.s @@ -132,7 +132,7 @@ TEXT bsdthread_create(SB),7,$-8 // The thread that bsdthread_create creates starts executing here, // because we registered this function using bsdthread_register // at startup. -// DI = "pthread" (= g) +// DI = "pthread" // SI = mach thread port // DX = "func" (= fn) // CX = "arg" (= m) @@ -141,7 +141,7 @@ TEXT bsdthread_create(SB),7,$-8 // SP = stack - C_64_REDZONE_LEN (= stack - 128) TEXT bsdthread_start(SB),7,$-8 MOVQ CX, m - MOVQ DI, g + MOVQ m_g0(m), g MOVQ SI, m_procid(m) // thread port is m->procid CALL DX // fn CALL exit1(SB)