github.com/go-darwin/sys@v0.0.0-20220510002607-68fd01f054ca/ccall.s (about)

     1  // Copyright 2009 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  //go:build darwin && amd64 && gc
     6  // +build darwin,amd64,gc
     7  
     8  #include "textflag.h"
     9  #include "funcdata.h"
    10  
    11  // func RawCcall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
    12  TEXT ·RawCcall9(SB), NOSPLIT, $0-104
    13  	MOVQ fn+0(FP), AX   // syscall entry
    14  	MOVQ a1+8(FP), DI
    15  	MOVQ a2+16(FP), SI
    16  	MOVQ a3+24(FP), DX
    17  	MOVQ a4+32(FP), R10
    18  	MOVQ a5+40(FP), R8
    19  	MOVQ a6+48(FP), R9
    20  	MOVQ a7+56(FP), R11
    21  	MOVQ a8+64(FP), R12
    22  	MOVQ a9+72(FP), R13
    23  	SUBQ $32, SP
    24  	MOVQ R11, 8(SP)
    25  	MOVQ R12, 16(SP)
    26  	MOVQ R13, 24(SP)
    27  	ADDQ $0x2000000, AX
    28  	SYSCALL
    29  	JCC  ok9
    30  	ADDQ $32, SP
    31  	MOVQ $-1, r1+80(FP)
    32  	MOVQ $0, r2+88(FP)
    33  	MOVQ AX, err+96(FP)
    34  	RET
    35  
    36  ok9:
    37  	ADDQ $32, SP
    38  	MOVQ AX, r1+80(FP)
    39  	MOVQ DX, r2+88(FP)
    40  	MOVQ $0, err+96(FP)
    41  	RET