]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix bug on darwin/amd64 - bad g in bsdthread_start
authorRuss Cox <rsc@golang.org>
Thu, 19 Nov 2009 02:17:11 +0000 (18:17 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 19 Nov 2009 02:17:11 +0000 (18:17 -0800)
R=r
https://golang.org/cl/157077

src/pkg/runtime/darwin/amd64/sys.s

index c39c44a699c1ee46d5173c12187c665b8e89e518..22a7c81973a40bdb8909210e913708721bee8674 100644 (file)
@@ -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)