Text file src/syscall/asm_netbsd_amd64.s

     1  // Copyright 2016 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  #include "funcdata.h"
     7  
     8  //
     9  // Syscall9 support for AMD64, NetBSD
    10  //
    11  
    12  // func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
    13  TEXT	·Syscall9(SB),NOSPLIT,$0-104
    14  	CALL	runtime·entersyscall(SB)
    15  	MOVQ	num+0(FP), AX	// syscall entry
    16  	MOVQ	a1+8(FP), DI
    17  	MOVQ	a2+16(FP), SI
    18  	MOVQ	a3+24(FP), DX
    19  	MOVQ	a4+32(FP), R10
    20  	MOVQ	a5+40(FP), R8
    21  	MOVQ	a6+48(FP), R9
    22  	MOVQ	a7+56(FP), R11
    23  	MOVQ	a8+64(FP), R12
    24  	MOVQ	a9+72(FP), R13
    25  	SUBQ    $32, SP
    26  	MOVQ	R11, 8(SP)	// arg 7
    27  	MOVQ	R12, 16(SP)	// arg 8
    28  	MOVQ	R13, 24(SP)	// arg 9
    29  	SYSCALL
    30  	JCC	ok9
    31  	ADDQ    $32, SP
    32  	MOVQ	$-1, 88(SP)	// r1
    33  	MOVQ	$0, 96(SP)	// r2
    34  	MOVQ	AX, 104(SP)	// errno
    35  	CALL	runtime·exitsyscall(SB)
    36  	RET
    37  ok9:
    38  	ADDQ    $32, SP
    39  	MOVQ	AX, 88(SP)	// r1
    40  	MOVQ	DX, 96(SP)	// r2
    41  	MOVQ	$0, 104(SP)	// errno
    42  	CALL	runtime·exitsyscall(SB)
    43  	RET
    44  

View as plain text