cpu_aix_ppc64.go 609 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 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. // +build aix,ppc64
  5. package cpu
  6. const cacheLineSize = 128
  7. const (
  8. // getsystemcfg constants
  9. _SC_IMPL = 2
  10. _IMPL_POWER8 = 0x10000
  11. _IMPL_POWER9 = 0x20000
  12. )
  13. func init() {
  14. impl := getsystemcfg(_SC_IMPL)
  15. if impl&_IMPL_POWER8 != 0 {
  16. PPC64.IsPOWER8 = true
  17. }
  18. if impl&_IMPL_POWER9 != 0 {
  19. PPC64.IsPOWER9 = true
  20. }
  21. Initialized = true
  22. }
  23. func getsystemcfg(label int) (n uint64) {
  24. r0, _ := callgetsystemcfg(label)
  25. n = uint64(r0)
  26. return
  27. }