PR go/83787
[official-gcc.git] / libgo / go / runtime / os_linux_ppc64x.go
blobd27902d794d66ccbf4c491dd3b8a1a75e7676093
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.
5 // +build ignore_for_gccgo
6 // +build ppc64 ppc64le
8 package runtime
10 // For go:linkname
11 import _ "unsafe"
13 // ppc64x doesn't have a 'cpuid' instruction equivalent and relies on
14 // HWCAP/HWCAP2 bits for hardware capabilities.
16 //go:linkname cpu_hwcap internal/cpu.ppc64x_hwcap
17 //go:linkname cpu_hwcap2 internal/cpu.ppc64x_hwcap2
18 var cpu_hwcap uint
19 var cpu_hwcap2 uint
21 func archauxv(tag, val uintptr) {
22 switch tag {
23 case _AT_HWCAP:
24 cpu_hwcap = uint(val)
25 case _AT_HWCAP2:
26 cpu_hwcap2 = uint(val)