github.com/ltltlt/go-source-code@v0.0.0-20190830023027-95be009773aa/syscall/asm_linux_mips64x.s (about)

     1  // Copyright 2014 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  // +build linux
     6  // +build mips64 mips64le
     7  
     8  #include "textflag.h"
     9  
    10  //
    11  // System calls for mips64, Linux
    12  //
    13  
    14  // func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
    15  
    16  TEXT	·Syscall(SB),NOSPLIT,$0-56
    17  	JAL	runtime·entersyscall(SB)
    18  	MOVV	a1+8(FP), R4
    19  	MOVV	a2+16(FP), R5
    20  	MOVV	a3+24(FP), R6
    21  	MOVV	R0, R7
    22  	MOVV	R0, R8
    23  	MOVV	R0, R9
    24  	MOVV	trap+0(FP), R2	// syscall entry
    25  	SYSCALL
    26  	BEQ	R7, ok
    27  	MOVV	$-1, R1
    28  	MOVV	R1, r1+32(FP)	// r1
    29  	MOVV	R0, r2+40(FP)	// r2
    30  	MOVV	R2, err+48(FP)	// errno
    31  	JAL	runtime·exitsyscall(SB)
    32  	RET
    33  ok:
    34  	MOVV	R2, r1+32(FP)	// r1
    35  	MOVV	R3, r2+40(FP)	// r2
    36  	MOVV	R0, err+48(FP)	// errno
    37  	JAL	runtime·exitsyscall(SB)
    38  	RET
    39  
    40  TEXT ·Syscall6(SB),NOSPLIT,$0-80
    41  	JAL	runtime·entersyscall(SB)
    42  	MOVV	a1+8(FP), R4
    43  	MOVV	a2+16(FP), R5
    44  	MOVV	a3+24(FP), R6
    45  	MOVV	a4+32(FP), R7
    46  	MOVV	a5+40(FP), R8
    47  	MOVV	a6+48(FP), R9
    48  	MOVV	trap+0(FP), R2	// syscall entry
    49  	SYSCALL
    50  	BEQ	R7, ok6
    51  	MOVV	$-1, R1
    52  	MOVV	R1, r1+56(FP)	// r1
    53  	MOVV	R0, r2+64(FP)	// r2
    54  	MOVV	R2, err+72(FP)	// errno
    55  	JAL	runtime·exitsyscall(SB)
    56  	RET
    57  ok6:
    58  	MOVV	R2, r1+56(FP)	// r1
    59  	MOVV	R3, r2+64(FP)	// r2
    60  	MOVV	R0, err+72(FP)	// errno
    61  	JAL	runtime·exitsyscall(SB)
    62  	RET
    63  
    64  TEXT ·RawSyscall(SB),NOSPLIT,$0-56
    65  	MOVV	a1+8(FP), R4
    66  	MOVV	a2+16(FP), R5
    67  	MOVV	a3+24(FP), R6
    68  	MOVV	R0, R7
    69  	MOVV	R0, R8
    70  	MOVV	R0, R9
    71  	MOVV	trap+0(FP), R2	// syscall entry
    72  	SYSCALL
    73  	BEQ	R7, ok1
    74  	MOVV	$-1, R1
    75  	MOVV	R1, r1+32(FP)	// r1
    76  	MOVV	R0, r2+40(FP)	// r2
    77  	MOVV	R2, err+48(FP)	// errno
    78  	RET
    79  ok1:
    80  	MOVV	R2, r1+32(FP)	// r1
    81  	MOVV	R3, r2+40(FP)	// r2
    82  	MOVV	R0, err+48(FP)	// errno
    83  	RET
    84  
    85  TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
    86  	MOVV	a1+8(FP), R4
    87  	MOVV	a2+16(FP), R5
    88  	MOVV	a3+24(FP), R6
    89  	MOVV	a4+32(FP), R7
    90  	MOVV	a5+40(FP), R8
    91  	MOVV	a6+48(FP), R9
    92  	MOVV	trap+0(FP), R2	// syscall entry
    93  	SYSCALL
    94  	BEQ	R7, ok2
    95  	MOVV	$-1, R1
    96  	MOVV	R1, r1+56(FP)	// r1
    97  	MOVV	R0, r2+64(FP)	// r2
    98  	MOVV	R2, err+72(FP)	// errno
    99  	RET
   100  ok2:
   101  	MOVV	R2, r1+56(FP)	// r1
   102  	MOVV	R3, r2+64(FP)	// r2
   103  	MOVV	R0, err+72(FP)	// errno
   104  	RET