We're allocating TLS storage for m0 anyway, so might as well use it.
Change-Id: I7dc20bbea5320c8ab8a367f18a9540706751e771
Reviewed-on: https://go-review.googlesource.com/16890
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
// store through it, to make sure it works
get_tls(BX)
MOVL $0x123, g(BX)
- MOVL runtime·tls0(SB), AX
+ MOVL runtime·m0+m_tls(SB), AX
CMPL AX, $0x123
JEQ ok
MOVL AX, 0 // abort
RET
TEXT runtime·ldt0setup(SB),NOSPLIT,$16-0
- // set up ldt 7 to point at tls0
+ // set up ldt 7 to point at m0.tls
// ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go.
// the entry number is just a hint. setldt will set up GS with what it used.
MOVL $7, 0(SP)
- LEAL runtime·tls0(SB), AX
+ LEAL runtime·m0+m_tls(SB), AX
MOVL AX, 4(SP)
MOVL $32, 8(SP) // sizeof(tls array)
CALL runtime·setldt(SB)
JMP ok
#endif
- LEAQ runtime·tls0(SB), DI
+ LEAQ runtime·m0+m_tls(SB), DI
CALL runtime·settls(SB)
// store through it, to make sure it works
get_tls(BX)
MOVQ $0x123, g(BX)
- MOVQ runtime·tls0(SB), AX
+ MOVQ runtime·m0+m_tls(SB), AX
CMPQ AX, $0x123
JEQ 2(PC)
MOVL AX, 0 // abort
nocpuinfo:
needtls:
- LEAL runtime·tls0(SB), DI
+ LEAL runtime·m0+m_tls(SB), DI
CALL runtime·settls(SB)
// store through it, to make sure it works
get_tls(BX)
MOVQ $0x123, g(BX)
- MOVQ runtime·tls0(SB), AX
+ MOVQ runtime·m0+m_tls(SB), AX
CMPQ AX, $0x123
JEQ 2(PC)
MOVL AX, 0 // abort
rbuf := make([]byte, unsafe.Sizeof(*r)+15)
tls := &mp.tls[0]
- if mp == &m0 {
- tls = &tls0[0]
- }
gp := *((**g)(unsafe.Pointer(tls)))
// align Context to 16 bytes
+#include "go_asm.h"
#include "textflag.h"
TEXT _rt0_ppc64le_linux(SB),NOSPLIT,$0
// Statically linked
MOVD 0(R1), R3 // argc
ADD $8, R1, R4 // argv
- MOVD $runtime·tls0(SB), R13 // TLS
+ MOVD $runtime·m0+m_tls(SB), R13 // TLS
ADD $0x7000, R13
dlink:
val uint64
}
-var tls0 [8]uintptr // available storage for m0's TLS; not necessarily used; opaque to GC
-
// Note: Called by runtime/pprof in addition to runtime code.
func tickspersecond() int64 {
r := int64(atomic.Load64(&ticks.val))