github.com/primecitizens/pcz/std@v0.2.1/rt0/rt0_arm64.s (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 //go:build !noos && arm64 5 6 #include "textflag.h" 7 8 #ifdef GOOS_linux 9 10 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 11 MOVD 0(RSP), R0 // argc 12 ADD $8, RSP, R1 // argv 13 JMP ·rt0<ABIInternal>(SB) 14 15 #endif 16 17 #ifdef GOOS_android 18 19 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 20 MOVD 0(RSP), R0 // argc 21 ADD $8, RSP, R1 // argv 22 JMP ·rt0<ABIInternal>(SB) 23 24 #endif 25 26 #ifdef GOOS_openbsd 27 28 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 29 MOVD 0(RSP), R0 // argc 30 ADD $8, RSP, R1 // argv 31 JMP ·rt0<ABIInternal>(SB) 32 33 #endif 34 35 #ifdef GOOS_netbsd 36 37 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 38 MOVD 0(RSP), R0 // argc 39 ADD $8, RSP, R1 // argv 40 JMP ·rt0<ABIInternal>(SB) 41 42 #endif 43 44 #ifdef GOOS_freebsd 45 46 // On FreeBSD argc/argv are passed in R0, not RSP 47 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 48 ADD $8, R0, R1 // argv 49 MOVD 0(R0), R0 // argc 50 JMP ·rt0<ABIInternal>(SB) 51 52 #endif 53 54 #ifdef GOOS_darwin 55 56 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 57 // R0: argc 58 // R1: argv 59 JMP ·rt0<ABIInternal>(SB) 60 61 #endif 62 63 #ifdef GOOS_ios 64 65 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 66 // R0: argc 67 // R1: argv 68 JMP ·rt0<ABIInternal>(SB) 69 70 #endif 71 72 #ifdef GOOS_windows 73 74 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 75 MOVD 0(RSP), R0 // argc 76 ADD $8, RSP, R1 // argv 77 JMP ·rt0<ABIInternal>(SB) 78 79 #endif