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.
5 //+build !amd64,!amd64p32,!386
17 procAuxv = "/proc/self/auxv"
19 uintSize = int(32 << (^uint(0) >> 63))
22 // For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2
23 // These are initialized in cpu_$GOARCH.go
24 // and should not be changed after they are initialized.
29 buf, err := ioutil.ReadFile(procAuxv)
31 // e.g. on android /proc/self/auxv is not accessible, so silently
32 // ignore the error and leave Initialized = false
37 for len(buf) >= 2*(uintSize/8) {
41 tag = uint(bo.Uint32(buf[0:]))
42 val = uint(bo.Uint32(buf[4:]))
45 tag = uint(bo.Uint64(buf[0:]))
46 val = uint(bo.Uint64(buf[8:]))