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

refac(hal_x86_64): misc interrupt module cleanup #497

Merged
merged 2 commits into from
Dec 30, 2024

Conversation

hawkw
Copy link
Owner

@hawkw hawkw commented Dec 30, 2024

No description provided.

I don't like that the module is just called "io", that feels weird.
Currently, all the interrupt service routines provided by the HAL are
defined inside of the `Idt::register_handlers` method. I did this
initially because they're only referenced inside that method. However,
this has the unfortunate side effect of making the *debug symbols* for
ISRs quite unpleasant, because `register_handlers` is generic. In GDB,
the symbol name for the PIT timer ISR is

```rust
hal_x86_64::interrupt::<impl hal_core::interrupt::Control for hal_x86_64::interrupt::idt::Idt>::register_handlers::pit_timer_isr
````

For an example, consider [this stack trace][1], which is horrible.

So, if you want to set a breakpoint on that ISR, you have to type all of
that, and also remember that this is the symbol name for the ISR, and
not something normal. This is annoying.

Therefore, this commit moves the ISR definitions out of this method and
into a top-level `hal_x86_64::interrupt::isr` module. Now, the names of
these symbols should be more like this:

```rust
hal_x86_64::interrupt::isr::pit_timer
```

Which seems a *lot* less unpleasant.

There should be no actual functional change here besides getting nicer
debug symbols.

[1]: c4183db#commitcomment-150799709
@hawkw hawkw enabled auto-merge (rebase) December 30, 2024 18:08
@hawkw hawkw merged commit b0d028f into main Dec 30, 2024
18 checks passed
@hawkw hawkw deleted the eliza/misc-interrupt-module-cleanup branch December 30, 2024 18:28
hawkw added a commit that referenced this pull request Dec 30, 2024
I don't like that the module is just called "io", that feels weird.
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.

1 participant