You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cpu_aix_ppc64.go 543B

123456789101112131415161718192021222324252627282930
  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. import "golang.org/x/sys/unix"
  7. const cacheLineSize = 128
  8. const (
  9. // getsystemcfg constants
  10. _SC_IMPL = 2
  11. _IMPL_POWER8 = 0x10000
  12. _IMPL_POWER9 = 0x20000
  13. )
  14. func init() {
  15. impl := unix.Getsystemcfg(_SC_IMPL)
  16. if impl&_IMPL_POWER8 != 0 {
  17. PPC64.IsPOWER8 = true
  18. }
  19. if impl&_IMPL_POWER9 != 0 {
  20. PPC64.IsPOWER9 = true
  21. }
  22. Initialized = true
  23. }