mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Not strictly necessary but will avoid spurious changes as files are edited. Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: I01667f826428426a39c84717d02efa25fa44553c Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490 TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matt Layher <mdlayher@gmail.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Russ Cox <rsc@golang.org>
37 lines
1011 B
Go
37 lines
1011 B
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Minimal copy of x/sys/unix so the cpu package can make a
|
|
// system call on AIX without depending on x/sys/unix.
|
|
// (See golang.org/issue/32102)
|
|
|
|
//go:build aix && ppc64 && gc
|
|
// +build aix,ppc64,gc
|
|
|
|
package cpu
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
//go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o"
|
|
|
|
//go:linkname libc_getsystemcfg libc_getsystemcfg
|
|
|
|
type syscallFunc uintptr
|
|
|
|
var libc_getsystemcfg syscallFunc
|
|
|
|
type errno = syscall.Errno
|
|
|
|
// Implemented in runtime/syscall_aix.go.
|
|
func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
|
|
func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
|
|
|
|
func callgetsystemcfg(label int) (r1 uintptr, e1 errno) {
|
|
r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0)
|
|
return
|
|
}
|