cpu_arm.odin 514 B

1234567891011121314151617181920212223242526
  1. //+build arm32, arm64
  2. package sysinfo
  3. // TODO: Set up an enum with the ARM equivalent of the above.
  4. CPU_Feature :: enum u64 {}
  5. cpu_features: Maybe(CPU_Feature)
  6. cpu_name: Maybe(string)
  7. @(init, private)
  8. init_cpu_features :: proc "c" () {
  9. }
  10. @(private)
  11. _cpu_name_buf: [72]u8
  12. @(init, private)
  13. init_cpu_name :: proc "c" () {
  14. when ODIN_ARCH == .arm32 {
  15. copy(_cpu_name_buf[:], "ARM")
  16. cpu_name = string(_cpu_name_buf[:3])
  17. } else {
  18. copy(_cpu_name_buf[:], "ARM64")
  19. cpu_name = string(_cpu_name_buf[:5])
  20. }
  21. }