Open hawkw opened 4 years ago
we might actually want the actual implementation of this to be in the Vector
trait, with a ref to the interrupt controller; depending on the interrupt, the way it is masked might differ, for example, on x86, it could be a CPU interrupt, a PIC interrupt, or an IOAPIC interrupt...
cc @iximeow
this will probably help with IOAPIC (#28) and PIC drivers.
probably something like the existing
Control::enable_irq
/disable_irq
, but for a specific vector https://github.com/hawkw/mycelium/blob/ff48f5732338f00be8026e758a2913e855452bd0/hal-core/src/interrupt.rs#L10-L14we can then use this to implement a drop guard API, like
enter_critical
: https://github.com/hawkw/mycelium/blob/ff48f5732338f00be8026e758a2913e855452bd0/hal-core/src/interrupt.rs#L34-L39(possibly
enable_irq
anddisable_irq
should be renamed toenable_all
/disable_all
or something — that naming incorrectly implies that they enable/disable a specific IRQ...)