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

View as plain text