github.com/primecitizens/pcz/std@v0.2.1/core/stack/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 ·GetSP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0 13 MOVD RSP, R0 14 RET 15 16 TEXT ·SetSP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0 17 MOVD R0, RSP 18 RET 19 20 TEXT ·GetFP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0 21 MOVD R29, R0 22 RET 23 24 // morestack but not preserving ctxt. 25 TEXT runtime·morestack_noctxt(SB),NOSPLIT|NOFRAME,$0-0 26 // Force SPWRITE. This function doesn't actually write SP, 27 // but it is called with a special calling convention where 28 // the caller doesn't save LR on stack but passes it as a 29 // register (R3), and the unwinder currently doesn't understand. 30 // Make it SPWRITE to stop unwinding. (See issue 54332) 31 MOVD RSP, RSP 32 33 MOVW $0, R26 34 B runtime·morestack(SB) 35 36 // Called during function prolog when more stack is needed. 37 // Caller has already loaded: 38 // R3 prolog's LR (R30) 39 // 40 // The traceback routines see morestack on a g0 as being 41 // the top of a stack (for example, morestack calling newstack 42 // calling the scheduler calling newm calling gc), so we must 43 // record an argument size. For that purpose, it has no arguments. 44 TEXT runtime·morestack(SB),NOSPLIT|NOFRAME,$0-0 45 // TODO: implement 46 UNDEF // crash