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(d1): make Plic::mask actually do that #348

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Dec 27, 2024

PR #312 (commit df41dec) inadvertently broke the Plic method to mask an interrupt by copy-pasting the code from Plic::unmask.

Previously, Plic::unmask would write MIE[offset]| irq_en to MIE[offset], setting the IRQ_EN bit for that interrupt; while Plic::mask would write MIE[offset] & !irq_en to MIE[offset], unsetting the IRQ_EN bit. But now they both set the IRQ_EN bit, so masking an interrupt actually unmasks it. Whoopsie. This seems to have occurred because I'm a LOSER FUCKING IDIOT.

This commit puts it back the way it was supposed to be. Sorry.

Fixes #347

PR #312 (commit df41dec) inadvertently
broke the `Plic` method to mask an interrupt by copy-pasting the code
from `Plic::unmask`.

Previously, `Plic::unmask` would write `MIE[offset] | irq_en` to
`MIE[offset]`, setting the `IRQ_EN` bit for that interrupt; while
`Plic::mask` would write `MIE[offset] & !irq_en` to `MIE[offset]`,
unsetting the `IRQ_EN `bit. But now they both *set* the `IRQ_EN` bit, so
masking an interrupt actually *unmasks* it. Whoopsie. This seems to have
occurred because I'm a LOSER FUCKING IDIOT.

This commit puts it back the way it was supposed to be. Sorry.

Fixes #347
@hawkw hawkw force-pushed the eliza/fix-plic-mask branch from 09e9b38 to 301ee0f Compare December 27, 2024 18:24
@hawkw hawkw enabled auto-merge December 27, 2024 18:24
@hawkw hawkw added this pull request to the merge queue Dec 27, 2024
Merged via the queue into main with commit 5f4bc9e Dec 27, 2024
12 checks passed
@hawkw hawkw deleted the eliza/fix-plic-mask branch December 27, 2024 18:39
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.

platform(D1) : Plic::mask actually does the opposite of that
1 participant