| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Go Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style | |
| 3 // license that can be found in the LICENSE file. | |
| 4 | |
| 5 #include "zasm_GOOS_GOARCH.h" | |
|
minux
2014/07/02 04:21:14
isn't asm_tls_android_arm.s too long?
I think tls_
crawshaw
2014/07/02 14:57:22
Done. Both merged into tls_arm.s.
| |
| 6 #include "funcdata.h" | |
| 7 #include "../../cmd/ld/textflag.h" | |
| 8 | |
| 9 // On android, runtime.tlsg is a normal variable. | |
| 10 // TLS offset is computed in x_cgo_inittls. | |
| 11 // See asm_tls_arm.h. | |
| 12 | |
| 13 TEXT runtime·save_g(SB),NOSPLIT,$0 | |
| 14 MRC 15, 0, R0, C13, C0, 3 // fetch TLS base pointer | |
| 15 MOVW runtime·tlsg(SB), R11 | |
| 16 ADD R11, R0 | |
| 17 MOVW g, 0(R0) | |
|
minux
2014/07/02 04:21:14
MOVW g, R11<<0(R0)
instead of ADD and MOVW.
same b
crawshaw
2014/07/02 14:57:22
Done.
| |
| 18 RET | |
| 19 | |
| 20 TEXT runtime·load_g(SB),NOSPLIT,$0 | |
| 21 MRC 15, 0, R0, C13, C0, 3 // fetch TLS base pointer | |
| 22 MOVW runtime·tlsg(SB), R11 | |
| 23 ADD R11, R0 | |
| 24 MOVW 0(R0), g | |
| 25 RET | |
| OLD | NEW |