github.com/bytedance/mockey@v1.2.10/internal/monkey/fn/copy_darwin_amd64_test.s (about) 1 /* 2 * Copyright 2022 ByteDance Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include "textflag.h" 18 19 #define sysWrite $(0x2000000+4) 20 21 TEXT ·callSystemFunc(SB),NOSPLIT,$0 22 MOVQ sysWrite, AX 23 MOVQ $1, DI 24 MOVQ msg_data+0(FP), SI 25 MOVQ msg_len+8(FP), DX 26 SYSCALL 27 MOVQ AX, ret+0(FP) 28 RET 29 30 TEXT ·callTwoAsmFunc(SB),NOSPLIT,$8 31 CALL ·asmFunc1(SB) 32 MOVQ tmp-8(SP), AX 33 MOVQ AX, res+0(FP) 34 CALL ·asmFunc2(SB) 35 MOVQ tmp-8(SP), AX 36 MOVQ AX, res+8(FP) 37 RET 38 39 TEXT ·asmFunc1(SB),NOSPLIT,$0 40 MOVQ $1, res+0(FP) 41 RET 42 43 TEXT ·asmFunc2(SB),NOSPLIT,$0 44 MOVQ $2, res+0(FP) 45 RET