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