Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Exceptions enum and table #114

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

Exceptions enum and table #114

wants to merge 1 commit into from

Conversation

romancardenas
Copy link
Contributor

I added an exception type enum and an exception handler table following the interrupts' fashion.

  • The standard exception types are defined in SiFive's interrupt cookbook.
  • For the exception handlers, I used Option<unsafe extern "C" fn(&TrapFrame)> instead of a union struct. The Rust compiler provides a niche optimization to represent None as 0 instead of adding an additional byte. This way is more rustacean than using a union and it is FFI safe.
  • By default, all the exception handlers are set to ExceptionHandler, so this PR should not break previous works that depended on a single handler.

@romancardenas romancardenas requested a review from a team as a code owner April 26, 2023 10:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant