cpuid_arm64.s 837 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file.
  2. //+build arm64,!gccgo
  3. // See https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt
  4. // func getMidr
  5. TEXT ·getMidr(SB), 7, $0
  6. WORD $0xd5380000 // mrs x0, midr_el1 /* Main ID Register */
  7. MOVD R0, midr+0(FP)
  8. RET
  9. // func getProcFeatures
  10. TEXT ·getProcFeatures(SB), 7, $0
  11. WORD $0xd5380400 // mrs x0, id_aa64pfr0_el1 /* Processor Feature Register 0 */
  12. MOVD R0, procFeatures+0(FP)
  13. RET
  14. // func getInstAttributes
  15. TEXT ·getInstAttributes(SB), 7, $0
  16. WORD $0xd5380600 // mrs x0, id_aa64isar0_el1 /* Instruction Set Attribute Register 0 */
  17. WORD $0xd5380621 // mrs x1, id_aa64isar1_el1 /* Instruction Set Attribute Register 1 */
  18. MOVD R0, instAttrReg0+0(FP)
  19. MOVD R1, instAttrReg1+8(FP)
  20. RET