github.com/primecitizens/pcz/std@v0.2.1/core/thread/asm_arm64.s (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 // 4 // Copyright 2015 The Go Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style 6 // license that can be found in the LICENSE file. 7 8 //go:build pcz && arm64 9 10 #include "textflag.h" 11 12 TEXT ·GetTLSBaseAddress<ABIInternal>(SB),NOSPLIT|NOFRAME,$0 13 #ifdef GOOS_darwin 14 WORD $0xd53bd060 // MRS TPIDRRO_EL0, R0 15 // Darwin sometimes returns unaligned pointers 16 AND $0xfffffffffffffff8, R0 17 #else 18 WORD $0xd53bd040 // MRS TPIDR_EL0, R0 19 #endif 20 RET 21 22 // func SetG(*stdgo.GHead) 23 TEXT ·SetG<ABIInternal>(SB),NOSPLIT|NOFRAME,$0 24 MOVD R0, g 25 RET 26 27 TEXT ·Topframe<ABIInternal>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 28 MOVD R1, RSP 29 JMP (R2) 30 RET