...
Run Format

Source file src/runtime/os_linux_ppc64x.go

Documentation: runtime

     1  // Copyright 2016 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.
     4  
     5  // +build ppc64 ppc64le
     6  
     7  package runtime
     8  
     9  // For go:linkname
    10  import _ "unsafe"
    11  
    12  // ppc64x doesn't have a 'cpuid' instruction equivalent and relies on
    13  // HWCAP/HWCAP2 bits for hardware capabilities.
    14  
    15  //go:linkname cpu_hwcap internal/cpu.ppc64x_hwcap
    16  //go:linkname cpu_hwcap2 internal/cpu.ppc64x_hwcap2
    17  var cpu_hwcap uint
    18  var cpu_hwcap2 uint
    19  
    20  func archauxv(tag, val uintptr) {
    21  	switch tag {
    22  	case _AT_HWCAP:
    23  		cpu_hwcap = uint(val)
    24  	case _AT_HWCAP2:
    25  		cpu_hwcap2 = uint(val)
    26  	}
    27  }
    28  

View as plain text