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

[arm64] enable cycle counter #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

raphui
Copy link

@raphui raphui commented Sep 1, 2016

Hello,

Cycle counter is not enable on arm64 arch, so the command line "bench" always return "took 0 cycles".

This patch enable cycle counter, let me know if it's ok or not.


int pmcr_mask = 1;

__asm__ volatile("msr pmcr_el0, %0":: "r"(pmcr_mask):);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but need to move it into the percpu routines, so it also gets initialized on more than just the first cpu.

@raphui
Copy link
Author

raphui commented Sep 6, 2016

Yes, you're right, I will do it and send a v2 pull request when I am back from holiday.

@travisg
Copy link
Member

travisg commented Sep 30, 2016

I did another implementation over in magenta that works on all processors. I'll try to merge that back soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants