1
2
3
4
5
6
7
8
9 package cpu
10
11
12 const (
13
14 _PPC_FEATURE2_ARCH_2_07 = 0x80000000
15 _PPC_FEATURE2_ARCH_3_00 = 0x00800000
16
17
18 _PPC_FEATURE2_DARN = 0x00200000
19 _PPC_FEATURE2_SCV = 0x00100000
20 )
21
22 func doinit() {
23
24 PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07)
25 PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00)
26 PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN)
27 PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV)
28 }
29
30 func isSet(hwc uint, value uint) bool {
31 return hwc&value != 0
32 }
33
View as plain text