From e1c5c3df77302af0bbc85c9374add746099f6c24 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 18 Nov 2009 18:17:11 -0800 Subject: [PATCH] runtime: fix bug on darwin/amd64 - bad g in bsdthread_start R=r https://golang.org/cl/157077 --- src/pkg/runtime/darwin/amd64/sys.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.48.1