| 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 |
//go:build linux && (ppc64 || ppc64le) |
| 6 |
|
| 7 |
#include "textflag.h" |
| 8 |
|
| 9 |
// func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) |
| 10 |
TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0-80 |
| 11 |
MOVD R3, R10 // Move syscall number to R10. SYSCALL will move it R0, and restore R0. |
| 12 |
MOVD R4, R3 |
| 13 |
MOVD R5, R4 |
| 14 |
MOVD R6, R5 |
| 15 |
MOVD R7, R6 |
| 16 |
MOVD R8, R7 |
| 17 |
MOVD R9, R8 |
| 18 |
SYSCALL R10 |
| 19 |
MOVD $-1, R6 |
| 20 |
ISEL CR0SO, R3, R0, R5 // errno = (error) ? R3 : 0 |
| 21 |
ISEL CR0SO, R6, R3, R3 // r1 = (error) ? -1 : 0 |
| 22 |
MOVD $0, R4 // r2 is not used on linux/ppc64 |
| 23 |
RET |