systemcfg.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. // +build aix
  2. package perfstat
  3. import "golang.org/x/sys/unix"
  4. // function Getsystemcfg() is defined in golang.org/x/sys/unix
  5. // we define here just missing constants for the function and some helpers
  6. // Calls to getsystemcfg()
  7. const (
  8. SC_ARCH = 1 /* processor architecture */
  9. SC_IMPL = 2 /* processor implementation */
  10. SC_VERS = 3 /* processor version */
  11. SC_WIDTH = 4 /* width (32 || 64) */
  12. SC_NCPUS = 5 /* 1 = UP, n = n-way MP */
  13. SC_L1C_ATTR = 6 /* L1 cache attributes (bit flags) */
  14. SC_L1C_ISZ = 7 /* size of L1 instruction cache */
  15. SC_L1C_DSZ = 8 /* size of L1 data cache */
  16. SC_L1C_ICA = 9 /* L1 instruction cache associativity */
  17. SC_L1C_DCA = 10 /* L1 data cache associativity */
  18. SC_L1C_IBS = 11 /* L1 instruction cache block size */
  19. SC_L1C_DBS = 12 /* L1 data cache block size */
  20. SC_L1C_ILS = 13 /* L1 instruction cache line size */
  21. SC_L1C_DLS = 14 /* L1 data cache line size */
  22. SC_L2C_SZ = 15 /* size of L2 cache, 0 = No L2 cache */
  23. SC_L2C_AS = 16 /* L2 cache associativity */
  24. SC_TLB_ATTR = 17 /* TLB attributes (bit flags) */
  25. SC_ITLB_SZ = 18 /* entries in instruction TLB */
  26. SC_DTLB_SZ = 19 /* entries in data TLB */
  27. SC_ITLB_ATT = 20 /* instruction tlb associativity */
  28. SC_DTLB_ATT = 21 /* data tlb associativity */
  29. SC_RESRV_SZ = 22 /* size of reservation */
  30. SC_PRI_LC = 23 /* spin lock count in supevisor mode */
  31. SC_PRO_LC = 24 /* spin lock count in problem state */
  32. SC_RTC_TYPE = 25 /* RTC type */
  33. SC_VIRT_AL = 26 /* 1 if hardware aliasing is supported */
  34. SC_CAC_CONG = 27 /* number of page bits for cache synonym */
  35. SC_MOD_ARCH = 28 /* used by system for model determination */
  36. SC_MOD_IMPL = 29 /* used by system for model determination */
  37. SC_XINT = 30 /* used by system for time base conversion */
  38. SC_XFRAC = 31 /* used by system for time base conversion */
  39. SC_KRN_ATTR = 32 /* kernel attributes, see below */
  40. SC_PHYSMEM = 33 /* bytes of OS available memory */
  41. SC_SLB_ATTR = 34 /* SLB attributes */
  42. SC_SLB_SZ = 35 /* size of slb (0 = no slb) */
  43. SC_ORIG_NCPUS = 36 /* original number of CPUs */
  44. SC_MAX_NCPUS = 37 /* max cpus supported by this AIX image */
  45. SC_MAX_REALADDR = 38 /* max supported real memory address +1 */
  46. SC_ORIG_ENT_CAP = 39 /* configured entitled processor capacity at boot required by cross-partition LPAR tools. */
  47. SC_ENT_CAP = 40 /* entitled processor capacity */
  48. SC_DISP_WHE = 41 /* Dispatch wheel time period (TB units) */
  49. SC_CAPINC = 42 /* delta by which capacity can change */
  50. SC_VCAPW = 43 /* priority weight for idle capacity distribution */
  51. SC_SPLP_STAT = 44 /* State of SPLPAR enablement: 0x1 => 1=SPLPAR capable; 0=not, 0x2 => SPLPAR enabled 0=dedicated, 1=shared */
  52. SC_SMT_STAT = 45 /* State of SMT enablement: 0x1 = SMT Capable 0=no/1=yes, 0x2 = SMT Enabled 0=no/1=yes, 0x4 = SMT threads bound true 0=no/1=yes */
  53. SC_SMT_TC = 46 /* Number of SMT Threads per Physical CPU */
  54. SC_VMX_VER = 47 /* RPA defined VMX version: 0 = VMX not available or disabled, 1 = VMX capable, 2 = VMX and VSX capable */
  55. SC_LMB_SZ = 48 /* Size of an LMB on this system. */
  56. SC_MAX_XCPU = 49 /* Number of exclusive cpus on line */
  57. SC_EC_LVL = 50 /* Kernel error checking level */
  58. SC_AME_STAT = 51 /* AME status */
  59. SC_ECO_STAT = 52 /* extended cache options */
  60. SC_DFP_STAT = 53 /* RPA defined DFP version, 0=none/disabled */
  61. SC_VRM_STAT = 54 /* VRM Capable/enabled */
  62. SC_PHYS_IMP = 55 /* physical processor implementation */
  63. SC_PHYS_VER = 56 /* physical processor version */
  64. SC_SPCM_STATUS = 57
  65. SC_SPCM_MAX = 58
  66. SC_TM_VER = 59 /* Transaction Memory version, 0 - not capable */
  67. SC_NX_CAP = 60 /* NX GZIP capable */
  68. SC_PKS_STATE = 61 /* Platform KeyStore */
  69. )
  70. /* kernel attributes */
  71. /* bit 0/1 meaning */
  72. /* -----------------------------------------*/
  73. /* 31 32-bit kernel / 64-bit kernel */
  74. /* 30 non-LPAR / LPAR */
  75. /* 29 old 64bit ABI / 64bit Large ABI */
  76. /* 28 non-NUMA / NUMA */
  77. /* 27 UP / MP */
  78. /* 26 no DR CPU add / DR CPU add support */
  79. /* 25 no DR CPU rm / DR CPU rm support */
  80. /* 24 no DR MEM add / DR MEM add support */
  81. /* 23 no DR MEM rm / DR MEM rm support */
  82. /* 22 kernel keys disabled / enabled */
  83. /* 21 no recovery / recovery enabled */
  84. /* 20 non-MLS / MLS enabled */
  85. /* 19 enhanced affinity indicator */
  86. /* 18 non-vTPM / vTPM enabled */
  87. /* 17 non-VIOS / VIOS */
  88. // Values for architecture field
  89. const (
  90. ARCH_POWER_RS = 0x0001 /* Power Classic architecture */
  91. ARCH_POWER_PC = 0x0002 /* Power PC architecture */
  92. ARCH_IA64 = 0x0003 /* Intel IA64 architecture */
  93. )
  94. // Values for implementation field for POWER_PC Architectures
  95. const (
  96. IMPL_POWER_RS1 = 0x00001 /* RS1 class CPU */
  97. IMPL_POWER_RSC = 0x00002 /* RSC class CPU */
  98. IMPL_POWER_RS2 = 0x00004 /* RS2 class CPU */
  99. IMPL_POWER_601 = 0x00008 /* 601 class CPU */
  100. IMPL_POWER_603 = 0x00020 /* 603 class CPU */
  101. IMPL_POWER_604 = 0x00010 /* 604 class CPU */
  102. IMPL_POWER_620 = 0x00040 /* 620 class CPU */
  103. IMPL_POWER_630 = 0x00080 /* 630 class CPU */
  104. IMPL_POWER_A35 = 0x00100 /* A35 class CPU */
  105. IMPL_POWER_RS64II = 0x0200 /* RS64-II class CPU */
  106. IMPL_POWER_RS64III = 0x0400 /* RS64-III class CPU */
  107. IMPL_POWER4 = 0x0800 /* 4 class CPU */
  108. IMPL_POWER_RS64IV = IMPL_POWER4 /* 4 class CPU */
  109. IMPL_POWER_MPC7450 = 0x1000 /* MPC7450 class CPU */
  110. IMPL_POWER5 = 0x2000 /* 5 class CPU */
  111. IMPL_POWER6 = 0x4000 /* 6 class CPU */
  112. IMPL_POWER7 = 0x8000 /* 7 class CPU */
  113. IMPL_POWER8 = 0x10000 /* 8 class CPU */
  114. IMPL_POWER9 = 0x20000 /* 9 class CPU */
  115. )
  116. // Values for implementation field for IA64 Architectures
  117. const (
  118. IMPL_IA64_M1 = 0x0001 /* IA64 M1 class CPU (Itanium) */
  119. IMPL_IA64_M2 = 0x0002 /* IA64 M2 class CPU */
  120. )
  121. // Values for the version field
  122. const (
  123. PV_601 = 0x010001 /* Power PC 601 */
  124. PV_601A = 0x010002 /* Power PC 601 */
  125. PV_603 = 0x060000 /* Power PC 603 */
  126. PV_604 = 0x050000 /* Power PC 604 */
  127. PV_620 = 0x070000 /* Power PC 620 */
  128. PV_630 = 0x080000 /* Power PC 630 */
  129. PV_A35 = 0x090000 /* Power PC A35 */
  130. PV_RS64II = 0x0A0000 /* Power PC RS64II */
  131. PV_RS64III = 0x0B0000 /* Power PC RS64III */
  132. PV_4 = 0x0C0000 /* Power PC 4 */
  133. PV_RS64IV = PV_4 /* Power PC 4 */
  134. PV_MPC7450 = 0x0D0000 /* Power PC MPC7450 */
  135. PV_4_2 = 0x0E0000 /* Power PC 4 */
  136. PV_4_3 = 0x0E0001 /* Power PC 4 */
  137. PV_5 = 0x0F0000 /* Power PC 5 */
  138. PV_5_2 = 0x0F0001 /* Power PC 5 */
  139. PV_5_3 = 0x0F0002 /* Power PC 5 */
  140. PV_6 = 0x100000 /* Power PC 6 */
  141. PV_6_1 = 0x100001 /* Power PC 6 DD1.x */
  142. PV_7 = 0x200000 /* Power PC 7 */
  143. PV_8 = 0x300000 /* Power PC 8 */
  144. PV_9 = 0x400000 /* Power PC 9 */
  145. PV_5_Compat = 0x0F8000 /* Power PC 5 */
  146. PV_6_Compat = 0x108000 /* Power PC 6 */
  147. PV_7_Compat = 0x208000 /* Power PC 7 */
  148. PV_8_Compat = 0x308000 /* Power PC 8 */
  149. PV_9_Compat = 0x408000 /* Power PC 9 */
  150. PV_RESERVED_2 = 0x0A0000 /* source compatability */
  151. PV_RESERVED_3 = 0x0B0000 /* source compatability */
  152. PV_RS2 = 0x040000 /* Power RS2 */
  153. PV_RS1 = 0x020000 /* Power RS1 */
  154. PV_RSC = 0x030000 /* Power RSC */
  155. PV_M1 = 0x008000 /* Intel IA64 M1 */
  156. PV_M2 = 0x008001 /* Intel IA64 M2 */
  157. )
  158. // Values for rtc_type
  159. const (
  160. RTC_POWER = 1 /* rtc as defined by Power Arch. */
  161. RTC_POWER_PC = 2 /* rtc as defined by Power PC Arch. */
  162. RTC_IA64 = 3 /* rtc as defined by IA64 Arch. */
  163. )
  164. const NX_GZIP_PRESENT = 0x00000001
  165. const (
  166. PKS_STATE_CAPABLE = 1
  167. PKS_STATE_ENABLED = 2
  168. )
  169. // Macros for identifying physical processor
  170. const (
  171. PPI4_1 = 0x35
  172. PPI4_2 = 0x38
  173. PPI4_3 = 0x39
  174. PPI4_4 = 0x3C
  175. PPI4_5 = 0x44
  176. PPI5_1 = 0x3A
  177. PPI5_2 = 0x3B
  178. PPI6_1 = 0x3E
  179. PPI7_1 = 0x3F
  180. PPI7_2 = 0x4A
  181. PPI8_1 = 0x4B
  182. PPI8_2 = 0x4D
  183. PPI9 = 0x4E
  184. )
  185. // Macros for kernel attributes
  186. const (
  187. KERN_TYPE = 0x1
  188. KERN_LPAR = 0x2
  189. KERN_64BIT_LARGE_ABI = 0x4
  190. KERN_NUMA = 0x8
  191. KERN_UPMP = 0x10
  192. KERN_DR_CPU_ADD = 0x20
  193. KERN_DR_CPU_RM = 0x40
  194. KERN_DR_MEM_ADD = 0x80
  195. KERN_DR_MEM_RM = 0x100
  196. KERN_KKEY_ENABLED = 0x200
  197. KERN_RECOVERY = 0x400
  198. KERN_MLS = 0x800
  199. KERN_ENH_AFFINITY = 0x1000
  200. KERN_VTPM = 0x2000
  201. KERN_VIOS = 0x4000
  202. )
  203. // macros for SPLPAR environment.
  204. const (
  205. SPLPAR_CAPABLE = 0x1
  206. SPLPAR_ENABLED = 0x2
  207. SPLPAR_DONATE_CAPABLE = 0x4
  208. )
  209. // Macros for SMT status determination
  210. const (
  211. SMT_CAPABLE = 0x1
  212. SMT_ENABLE = 0x2
  213. SMT_BOUND = 0x4
  214. SMT_ORDER = 0x8
  215. )
  216. // Macros for VRM status determination
  217. const (
  218. VRM_CAPABLE = 0x1
  219. VRM_ENABLE = 0x2
  220. CMOX_CAPABLE = 0x4
  221. )
  222. // Macros for AME status determination
  223. const AME_ENABLE = 0x1
  224. // Macros for extended cache options
  225. const (
  226. ECO_CAPABLE = 0x1
  227. ECO_ENABLE = 0x2
  228. )
  229. // These define blocks of values for model_arch and model_impl that are reserved for OEM use.
  230. const (
  231. MODEL_ARCH_RSPC = 2
  232. MODEL_ARCH_CHRP = 3
  233. MODEL_ARCH_IA64 = 4
  234. MODEL_ARCH_OEM_START = 1024
  235. MODEL_ARCH_OEM_END = 2047
  236. MODEL_IMPL_RS6K_UP_MCA = 1
  237. MODEL_IMPL_RS6K_SMP_MCA = 2
  238. MODEL_IMPL_RSPC_UP_PCI = 3
  239. MODEL_IMPL_RSPC_SMP_PCI = 4
  240. MODEL_IMPL_CHRP_UP_PCI = 5
  241. MODEL_IMPL_CHRP_SMP_PCI = 6
  242. MODEL_IMPL_IA64_COM = 7
  243. MODEL_IMPL_IA64_SOFTSDV = 8
  244. MODEL_IMPL_MAMBO_SIM = 9
  245. MODEL_IMPL_POWER_KVM = 10
  246. MODEL_IMPL_OEM_START = 1024
  247. MODEL_IMPL_OEM_END = 2047
  248. )
  249. // example determining processor compatibilty mode on AIX:
  250. // impl := unix.Getsystemcfg(SC_IMPL)
  251. // if impl&IMPL_POWER8 != 0 {
  252. // // we are running on POWER8
  253. // }
  254. // if impl&IMPL_POWER9 != 0 {
  255. // // we are running on POWER9
  256. // }
  257. func GetCPUImplementation() string {
  258. impl := unix.Getsystemcfg(SC_IMPL)
  259. switch {
  260. case impl&IMPL_POWER4 != 0:
  261. return "POWER4"
  262. case impl&IMPL_POWER5 != 0:
  263. return "POWER5"
  264. case impl&IMPL_POWER6 != 0:
  265. return "POWER6"
  266. case impl&IMPL_POWER7 != 0:
  267. return "POWER7"
  268. case impl&IMPL_POWER8 != 0:
  269. return "POWER8"
  270. case impl&IMPL_POWER9 != 0:
  271. return "POWER9"
  272. default:
  273. return "Unknown"
  274. }
  275. }
  276. func POWER9OrNewer() bool {
  277. impl := unix.Getsystemcfg(SC_IMPL)
  278. if impl&IMPL_POWER9 != 0 {
  279. return true
  280. }
  281. return false
  282. }
  283. func POWER9() bool {
  284. impl := unix.Getsystemcfg(SC_IMPL)
  285. if impl&IMPL_POWER9 != 0 {
  286. return true
  287. }
  288. return false
  289. }
  290. func POWER8OrNewer() bool {
  291. impl := unix.Getsystemcfg(SC_IMPL)
  292. if impl&IMPL_POWER9 != 0 || impl&IMPL_POWER8 != 0 {
  293. return true
  294. }
  295. return false
  296. }
  297. func POWER8() bool {
  298. impl := unix.Getsystemcfg(SC_IMPL)
  299. if impl&IMPL_POWER8 != 0 {
  300. return true
  301. }
  302. return false
  303. }
  304. func POWER7OrNewer() bool {
  305. impl := unix.Getsystemcfg(SC_IMPL)
  306. if impl&IMPL_POWER9 != 0 || impl&IMPL_POWER8 != 0 || impl&IMPL_POWER7 != 0 {
  307. return true
  308. }
  309. return false
  310. }
  311. func POWER7() bool {
  312. impl := unix.Getsystemcfg(SC_IMPL)
  313. if impl&IMPL_POWER7 != 0 {
  314. return true
  315. }
  316. return false
  317. }
  318. func HasTransactionalMemory() bool {
  319. impl := unix.Getsystemcfg(SC_TM_VER)
  320. if impl > 0 {
  321. return true
  322. }
  323. return false
  324. }
  325. func Is64Bit() bool {
  326. impl := unix.Getsystemcfg(SC_WIDTH)
  327. if impl == 64 {
  328. return true
  329. }
  330. return false
  331. }
  332. func IsSMP() bool {
  333. impl := unix.Getsystemcfg(SC_NCPUS)
  334. if impl > 1 {
  335. return true
  336. }
  337. return false
  338. }
  339. func HasVMX() bool {
  340. impl := unix.Getsystemcfg(SC_VMX_VER)
  341. if impl > 0 {
  342. return true
  343. }
  344. return false
  345. }
  346. func HasVSX() bool {
  347. impl := unix.Getsystemcfg(SC_VMX_VER)
  348. if impl > 1 {
  349. return true
  350. }
  351. return false
  352. }
  353. func HasDFP() bool {
  354. impl := unix.Getsystemcfg(SC_DFP_STAT)
  355. if impl > 1 {
  356. return true
  357. }
  358. return false
  359. }
  360. func HasNxGzip() bool {
  361. impl := unix.Getsystemcfg(SC_NX_CAP)
  362. if impl&NX_GZIP_PRESENT > 0 {
  363. return true
  364. }
  365. return false
  366. }
  367. func PksCapable() bool {
  368. impl := unix.Getsystemcfg(SC_PKS_STATE)
  369. if impl&PKS_STATE_CAPABLE > 0 {
  370. return true
  371. }
  372. return false
  373. }
  374. func PksEnabled() bool {
  375. impl := unix.Getsystemcfg(SC_PKS_STATE)
  376. if impl&PKS_STATE_ENABLED > 0 {
  377. return true
  378. }
  379. return false
  380. }
  381. func CPUMode() string {
  382. impl := unix.Getsystemcfg(SC_VERS)
  383. switch impl {
  384. case PV_9, PV_9_Compat:
  385. return "POWER9"
  386. case PV_8, PV_8_Compat:
  387. return "POWER8"
  388. case PV_7, PV_7_Compat:
  389. return "POWER7"
  390. default:
  391. return "Unknown"
  392. }
  393. }
  394. func KernelBits() int {
  395. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  396. if impl&KERN_TYPE == KERN_TYPE {
  397. return 64
  398. }
  399. return 32
  400. }
  401. func IsLPAR() bool {
  402. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  403. if impl&KERN_LPAR == KERN_LPAR {
  404. return true
  405. }
  406. return false
  407. }
  408. func CpuAddCapable() bool {
  409. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  410. if impl&KERN_DR_CPU_ADD == KERN_DR_CPU_ADD {
  411. return true
  412. }
  413. return false
  414. }
  415. func CpuRemoveCapable() bool {
  416. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  417. if impl&KERN_DR_CPU_RM == KERN_DR_CPU_RM {
  418. return true
  419. }
  420. return false
  421. }
  422. func MemoryAddCapable() bool {
  423. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  424. if impl&KERN_DR_MEM_ADD == KERN_DR_MEM_ADD {
  425. return true
  426. }
  427. return false
  428. }
  429. func MemoryRemoveCapable() bool {
  430. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  431. if impl&KERN_DR_MEM_RM == KERN_DR_MEM_RM {
  432. return true
  433. }
  434. return false
  435. }
  436. func DLparCapable() bool {
  437. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  438. if impl&(KERN_DR_CPU_ADD|KERN_DR_CPU_RM|KERN_DR_MEM_ADD|KERN_DR_MEM_RM) > 0 {
  439. return true
  440. }
  441. return false
  442. }
  443. func IsNUMA() bool {
  444. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  445. if impl&KERN_NUMA > 0 {
  446. return true
  447. }
  448. return false
  449. }
  450. func KernelKeys() bool {
  451. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  452. if impl&KERN_KKEY_ENABLED > 0 {
  453. return true
  454. }
  455. return false
  456. }
  457. func RecoveryMode() bool {
  458. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  459. if impl&KERN_RECOVERY > 0 {
  460. return true
  461. }
  462. return false
  463. }
  464. func EnhancedAffinity() bool {
  465. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  466. if impl&KERN_ENH_AFFINITY > 0 {
  467. return true
  468. }
  469. return false
  470. }
  471. func VTpmEnabled() bool {
  472. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  473. if impl&KERN_VTPM > 0 {
  474. return true
  475. }
  476. return false
  477. }
  478. func IsVIOS() bool {
  479. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  480. if impl&KERN_VIOS > 0 {
  481. return true
  482. }
  483. return false
  484. }
  485. func MLSEnabled() bool {
  486. impl := unix.Getsystemcfg(SC_KRN_ATTR)
  487. if impl&KERN_MLS > 0 {
  488. return true
  489. }
  490. return false
  491. }
  492. func SPLparCapable() bool {
  493. impl := unix.Getsystemcfg(SC_SPLP_STAT)
  494. if impl&SPLPAR_CAPABLE > 0 {
  495. return true
  496. }
  497. return false
  498. }
  499. func SPLparEnabled() bool {
  500. impl := unix.Getsystemcfg(SC_SPLP_STAT)
  501. if impl&SPLPAR_ENABLED > 0 {
  502. return true
  503. }
  504. return false
  505. }
  506. func DedicatedLpar() bool {
  507. return !SPLparEnabled()
  508. }
  509. func SPLparCapped() bool {
  510. impl := unix.Getsystemcfg(SC_VCAPW)
  511. if impl == 0 {
  512. return true
  513. }
  514. return false
  515. }
  516. func SPLparDonating() bool {
  517. impl := unix.Getsystemcfg(SC_SPLP_STAT)
  518. if impl&SPLPAR_DONATE_CAPABLE > 0 {
  519. return true
  520. }
  521. return false
  522. }
  523. func SmtCapable() bool {
  524. impl := unix.Getsystemcfg(SC_SMT_STAT)
  525. if impl&SMT_CAPABLE > 0 {
  526. return true
  527. }
  528. return false
  529. }
  530. func SmtEnabled() bool {
  531. impl := unix.Getsystemcfg(SC_SMT_STAT)
  532. if impl&SMT_ENABLE > 0 {
  533. return true
  534. }
  535. return false
  536. }
  537. func VrmCapable() bool {
  538. impl := unix.Getsystemcfg(SC_VRM_STAT)
  539. if impl&VRM_CAPABLE > 0 {
  540. return true
  541. }
  542. return false
  543. }
  544. func VrmEnabled() bool {
  545. impl := unix.Getsystemcfg(SC_VRM_STAT)
  546. if impl&VRM_ENABLE > 0 {
  547. return true
  548. }
  549. return false
  550. }
  551. func AmeEnabled() bool {
  552. impl := unix.Getsystemcfg(SC_AME_STAT)
  553. if impl&AME_ENABLE > 0 {
  554. return true
  555. }
  556. return false
  557. }
  558. func EcoCapable() bool {
  559. impl := unix.Getsystemcfg(SC_ECO_STAT)
  560. if impl&ECO_CAPABLE > 0 {
  561. return true
  562. }
  563. return false
  564. }
  565. func EcoEnabled() bool {
  566. impl := unix.Getsystemcfg(SC_ECO_STAT)
  567. if impl&ECO_ENABLE > 0 {
  568. return true
  569. }
  570. return false
  571. }