]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add a comment about thread pointer alignment on darwin/arm64
authorCherry Zhang <cherryyz@google.com>
Fri, 30 Oct 2020 21:16:51 +0000 (17:16 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 30 Oct 2020 22:36:07 +0000 (22:36 +0000)
Address a review comment in CL 266373.

Change-Id: Ic21bd5c4f87fd0c7dc594155a10fe23602698187
Reviewed-on: https://go-review.googlesource.com/c/go/+/266777
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/race_arm64.s

index 59373a9f3f4cc23017191d77cbcb69e2859a64c1..5b1a1cb89a1dcaed53171a3a1d5eaab4bc43669f 100644 (file)
 
 // The race ctx, ThreadState *thr below, is passed in R0 and loaded in racecalladdr.
 
+// Darwin may return unaligned thread pointer. Align it. (See tls_arm64.s)
+// No-op on other OSes.
 #ifdef TLS_darwin
 #define TP_ALIGN       AND     $~7, R0
 #else
 #define TP_ALIGN
 #endif
 
+// Load g from TLS. (See tls_arm64.s)
 #define load_g \
        MRS_TPIDR_R0 \
        TP_ALIGN \