Source file
src/internal/cpu/cpu_arm64_darwin.go
1
2
3
4
5
6
7 package cpu
8
9 func osInit() {
10 ARM64.HasATOMICS = sysctlEnabled([]byte("hw.optional.armv8_1_atomics\x00"))
11 ARM64.HasCRC32 = sysctlEnabled([]byte("hw.optional.armv8_crc32\x00"))
12
13
14
15
16
17 ARM64.HasAES = true
18 ARM64.HasPMULL = true
19 ARM64.HasSHA1 = true
20 ARM64.HasSHA2 = true
21 }
22
23
24 func getsysctlbyname(name []byte) (int32, int32)
25
26 func sysctlEnabled(name []byte) bool {
27 ret, value := getsysctlbyname(name)
28 if ret < 0 {
29 return false
30 }
31 return value > 0
32 }
33
View as plain text