aboutsummaryrefslogtreecommitdiff
path: root/src/internal/cpu/cpu_ppc64x.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/cpu/cpu_ppc64x.go')
-rw-r--r--src/internal/cpu/cpu_ppc64x.go27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/internal/cpu/cpu_ppc64x.go b/src/internal/cpu/cpu_ppc64x.go
index 2487879c46..beb1765427 100644
--- a/src/internal/cpu/cpu_ppc64x.go
+++ b/src/internal/cpu/cpu_ppc64x.go
@@ -8,39 +8,14 @@ package cpu
const CacheLinePadSize = 128
-// ppc64x doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
-// These are initialized by archauxv and should not be changed after they are
-// initialized.
-// On aix/ppc64, these values are initialized early in the runtime in runtime/os_aix.go.
-var HWCap uint
-var HWCap2 uint
-
-// HWCAP/HWCAP2 bits. These are exposed by the kernel.
-const (
- // ISA Level
- PPC_FEATURE2_ARCH_2_07 = 0x80000000
- PPC_FEATURE2_ARCH_3_00 = 0x00800000
-
- // CPU features
- PPC_FEATURE2_DARN = 0x00200000
- PPC_FEATURE2_SCV = 0x00100000
-)
-
func doinit() {
options = []option{
{Name: "darn", Feature: &PPC64.HasDARN},
{Name: "scv", Feature: &PPC64.HasSCV},
{Name: "power9", Feature: &PPC64.IsPOWER9},
-
- // These capabilities should always be enabled on ppc64 and ppc64le:
- {Name: "power8", Feature: &PPC64.IsPOWER8, Required: true},
}
- // HWCAP2 feature bits
- PPC64.IsPOWER8 = isSet(HWCap2, PPC_FEATURE2_ARCH_2_07)
- PPC64.IsPOWER9 = isSet(HWCap2, PPC_FEATURE2_ARCH_3_00)
- PPC64.HasDARN = isSet(HWCap2, PPC_FEATURE2_DARN)
- PPC64.HasSCV = isSet(HWCap2, PPC_FEATURE2_SCV)
+ osinit()
}
func isSet(hwc uint, value uint) bool {