Text file src/syscall/asm_linux_mipsx.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  //go:build linux && (mips || mipsle)
     6  
     7  #include "textflag.h"
     8  #include "funcdata.h"
     9  
    10  //
    11  // System calls for mips, Linux
    12  //
    13  
    14  // func Syscall9(trap trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr);
    15  // Actually Syscall8 but the rest of the code expects it to be named Syscall9.
    16  TEXT ·Syscall9(SB),NOSPLIT,$28-52
    17  	NO_LOCAL_POINTERS
    18  	JAL	runtime·entersyscall(SB)
    19  	MOVW	a1+4(FP), R4
    20  	MOVW	a2+8(FP), R5
    21  	MOVW	a3+12(FP), R6
    22  	MOVW	a4+16(FP), R7
    23  	MOVW	a5+20(FP), R8
    24  	MOVW	a6+24(FP), R9
    25  	MOVW	a7+28(FP), R10
    26  	MOVW	a8+32(FP), R11
    27  	MOVW	R8, 16(R29)
    28  	MOVW	R9, 20(R29)
    29  	MOVW	R10, 24(R29)
    30  	MOVW	R11, 28(R29)
    31  	MOVW	trap+0(FP), R2	// syscall entry
    32  	SYSCALL
    33  	BEQ	R7, ok9
    34  	MOVW	$-1, R1
    35  	MOVW	R1, r1+40(FP)	// r1
    36  	MOVW	R0, r2+44(FP)	// r2
    37  	MOVW	R2, err+48(FP)	// errno
    38  	JAL	runtime·exitsyscall(SB)
    39  	RET
    40  ok9:
    41  	MOVW	R2, r1+40(FP)	// r1
    42  	MOVW	R3, r2+44(FP)	// r2
    43  	MOVW	R0, err+48(FP)	// errno
    44  	JAL	runtime·exitsyscall(SB)
    45  	RET
    46  
    47  // func rawVforkSyscall(trap, a1 uintptr) (r1, err uintptr)
    48  TEXT ·rawVforkSyscall(SB),NOSPLIT|NOFRAME,$0-16
    49  	MOVW	a1+4(FP), R4
    50  	MOVW	R0, R5
    51  	MOVW	R0, R6
    52  	MOVW	trap+0(FP), R2	// syscall entry
    53  	SYSCALL
    54  	BEQ	R7, ok
    55  	MOVW	$-1, R1
    56  	MOVW	R1, r1+8(FP)	// r1
    57  	MOVW	R2, err+12(FP)	// errno
    58  	RET
    59  ok:
    60  	MOVW	R2, r1+8(FP)	// r1
    61  	MOVW	R0, err+12(FP)	// errno
    62  	RET
    63  
    64  TEXT ·rawSyscallNoError(SB),NOSPLIT,$20-24
    65  	MOVW	a1+4(FP), R4
    66  	MOVW	a2+8(FP), R5
    67  	MOVW	a3+12(FP), R6
    68  	MOVW	trap+0(FP), R2	// syscall entry
    69  	SYSCALL
    70  	MOVW	R2, r1+16(FP)	// r1
    71  	MOVW	R3, r2+20(FP)	// r2
    72  	RET
    73  

View as plain text