Text file src/runtime/internal/syscall/asm_linux_amd64.s

     1  // Copyright 2022 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  #include "textflag.h"
     6  
     7  // func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
     8  //
     9  // Syscall # in AX, args in DI SI DX R10 R8 R9, return in AX DX.
    10  //
    11  // Note that this differs from "standard" ABI convention, which would pass 4th
    12  // arg in CX, not R10.
    13  TEXT ·Syscall6(SB),NOSPLIT,$0-80
    14  	MOVQ	num+0(FP), AX	// syscall entry
    15  	MOVQ	a1+8(FP), DI
    16  	MOVQ	a2+16(FP), SI
    17  	MOVQ	a3+24(FP), DX
    18  	MOVQ	a4+32(FP), R10
    19  	MOVQ	a5+40(FP), R8
    20  	MOVQ	a6+48(FP), R9
    21  	SYSCALL
    22  	CMPQ	AX, $0xfffffffffffff001
    23  	JLS	ok
    24  	MOVQ	$-1, r1+56(FP)
    25  	MOVQ	$0, r2+64(FP)
    26  	NEGQ	AX
    27  	MOVQ	AX, errno+72(FP)
    28  	RET
    29  ok:
    30  	MOVQ	AX, r1+56(FP)
    31  	MOVQ	DX, r2+64(FP)
    32  	MOVQ	$0, errno+72(FP)
    33  	RET
    34  

View as plain text