Skip to content

Commit

Permalink
refac(hal_x86_64): define ISRs at the top level (#497)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hawkw committed Dec 30, 2024
1 parent 05c7aab commit b0d028f
Showing 1 changed file with 243 additions and 226 deletions.
Loading

0 comments on commit b0d028f

Please sign in to comment.