1
2
3
4
5
6
7 package cpu
8
9
10 const (
11
12 _PPC_FEATURE2_ARCH_2_07 = 0x80000000
13 _PPC_FEATURE2_ARCH_3_00 = 0x00800000
14
15
16 _PPC_FEATURE2_DARN = 0x00200000
17 _PPC_FEATURE2_SCV = 0x00100000
18 )
19
20 func doinit() {
21
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 }
31
View as plain text