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

[ISSUE-29] IRQ handlers with no conditional branching #37

Merged

Conversation

michalfita
Copy link
Contributor

I know @Lurk PRed his fix for #29 and it was approved, but this is suggestion how to avoid conditional branching in the interrupt handler. It doesn't panic if the handler is already set yet, but can be added.

You may like it or not, I don't mind if you reject this PR.

Coming from the embedded work first thing that struck me was how to make interrupt handler as efficient as possible; I have even rough idea how to avoid Box<> in the array, but that's more work I don't have time for at the moment: we could only keep array of references to trait implementation, and static instances holding particular interrupt handler - if done right it wouldn't even need to panic, assuming IRQ# assignment at compile time is acceptable for all cases.

Copy link

@LionsAd LionsAd left a comment

Choose a reason for hiding this comment

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

FWIW: This looks great and correct to me.

Copy link
Owner

@nuta nuta left a comment

Choose a reason for hiding this comment

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

Works well on my QEMU.

@nuta nuta merged commit 2f8f397 into nuta:main Nov 1, 2021
@nuta
Copy link
Owner

nuta commented Nov 1, 2021

Thank you @michalfita! I have no idea how not to use Box and MaybeUninit here. Let's go with them for now.

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.

3 participants