1// Copyright 2019 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// Minimal copy of x/sys/unix so the cpu package can make a
 6// system call on AIX without depending on x/sys/unix.
 7// (See golang.org/issue/32102)
 8
 9//go:build aix && ppc64 && gc
10
11package cpu
12
13import (
14	"syscall"
15	"unsafe"
16)
17
18//go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o"
19
20//go:linkname libc_getsystemcfg libc_getsystemcfg
21
22type syscallFunc uintptr
23
24var libc_getsystemcfg syscallFunc
25
26type errno = syscall.Errno
27
28// Implemented in runtime/syscall_aix.go.
29func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
30func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
31
32func callgetsystemcfg(label int) (r1 uintptr, e1 errno) {
33	r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0)
34	return
35}