Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refer to the cntvctss_el0 system register by number. #3860

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/test/arm/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <sys/prctl.h>
#include <stdio.h>

// For compatibility with pre-2.38 versions of binutils.
#define cntvctss_el0 "s3_3_c14_c0_6"

long cntfrq(void) {
long c;
__asm__ __volatile__("mrs %0, cntfrq_el0" : "=r"(c));
Expand All @@ -19,7 +22,7 @@ long cntvct(void) {
long cntvctss(void) {
long c;
if (getauxval(AT_HWCAP2) & HWCAP2_ECV) {
__asm__ __volatile__(".arch armv8.6-a\nmrs %0, cntvctss_el0" : "=r"(c));
__asm__ __volatile__(".arch armv8.6-a\nmrs %0, " cntvctss_el0 : "=r"(c));
} else {
__asm__ __volatile__("mrs %0, cntvct_el0" : "=r"(c));
}
Expand All @@ -33,7 +36,7 @@ void arch_timer_nops(void) {
__asm__ __volatile__("mrs xzr, cntfrq_el0");
__asm__ __volatile__("mrs xzr, cntvct_el0");
if (getauxval(AT_HWCAP2) & HWCAP2_ECV) {
__asm__ __volatile__("mrs xzr, cntvctss_el0");
__asm__ __volatile__("mrs xzr, " cntvctss_el0);
}
}

Expand Down