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

* Enable interrupts, set up the mtvec, and print a simple #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

schirice
Copy link
Contributor

@schirice schirice commented May 4, 2021

debug msg when a trap occurs so we know the mtval, mepc, and mcause.

 debug msg when a trap occurs so we know the mtval, mepc, and mcause.
@schirice schirice requested review from arunthomas and aroelke May 4, 2021 13:31

void bad_trap(){
unsigned long mepc, mtval, mcause;
asm volatile("csrr %0, mcause" : "=r"(mcause));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use read_csr here (and the below lines)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason, I could ... less code being generated this way though.

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