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

🐛 Fix bug in CRT0 trap handler #812

Merged
merged 3 commits into from
Feb 17, 2024
Merged

🐛 Fix bug in CRT0 trap handler #812

merged 3 commits into from
Feb 17, 2024

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Feb 17, 2024

If the C ISA extension is disabled the early boot trap handler in crt0 fails to compute the correct return address. The handler increments mepc two times by "+2", which is not possible without C support as mepc[1] is hardwired to zero.

This is just a minor bug as there should be no exceptions during crt0's early boot stage.

@stnolting stnolting added bug Something isn't working as expected SW Software-related labels Feb 17, 2024
@stnolting stnolting self-assigned this Feb 17, 2024
@stnolting stnolting marked this pull request as ready for review February 17, 2024 20:47
@stnolting stnolting merged commit 772e0e2 into main Feb 17, 2024
8 checks passed
@stnolting stnolting deleted the fix_crt0_trap branch February 17, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected SW Software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant