diff options
| author | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
|---|---|---|
| committer | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
| commit | 404aeae4545d2426c089a5f8d5e82dae56f5212b (patch) | |
| tree | 2d84e00af272b39fc04f3795ae06bc48970e57b5 /vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go | |
| parent | 209d8b0187ed025dec9ac149ebcced3462877bff (diff) | |
| download | gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.tar.gz gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.zip | |
Make Nix builds work
Diffstat (limited to 'vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go')
| -rw-r--r-- | vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go new file mode 100644 index 0000000..197188e --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2018 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 | package cpu | ||
| 8 | |||
| 9 | // HWCAP/HWCAP2 bits. These are exposed by the kernel. | ||
| 10 | const ( | ||
| 11 | // ISA Level | ||
| 12 | _PPC_FEATURE2_ARCH_2_07 = 0x80000000 | ||
| 13 | _PPC_FEATURE2_ARCH_3_00 = 0x00800000 | ||
| 14 | |||
| 15 | // CPU features | ||
| 16 | _PPC_FEATURE2_DARN = 0x00200000 | ||
| 17 | _PPC_FEATURE2_SCV = 0x00100000 | ||
| 18 | ) | ||
| 19 | |||
| 20 | func doinit() { | ||
| 21 | // HWCAP2 feature bits | ||
| 22 | PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) | ||
| 23 | PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) | ||
| 24 | PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) | ||
| 25 | PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) | ||
| 26 | } | ||
| 27 | |||
| 28 | func isSet(hwc uint, value uint) bool { | ||
| 29 | return hwc&value != 0 | ||
| 30 | } | ||