--- a/libgo/go/internal/cpu/cpu_gccgo.c +++ b/libgo/go/internal/cpu/cpu_gccgo.c @@ -200,3 +200,29 @@ struct queryResult kdsaQuery() { } #endif /* defined(__s390x__) */ + +#ifdef __aarch64__ + +uint64_t getisar0(void) + __asm__(GOSYM_PREFIX "internal_1cpu.getisar0") + __attribute__((no_split_stack)); + +uint64_t getisar0() { + uint64_t isar0; + + __asm__("mrs %0,id_aa64isar0_el1" : "=r"(isar0)); + return isar0; +} + +uint64_t getMIDR(void) + __asm__(GOSYM_PREFIX "internal_1cpu.getMIDR") + __attribute__((no_split_stack)); + +uint64_t getMIDR() { + uint64_t MIDR; + + __asm__("mrs %0,midr_el1" : "=r"(MIDR)); + return MIDR; +} + +#endif /* defined(__aarch64__) */
-- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."