Kernel: Replace IRQHandler with the new InterruptHandler class

System components that need an IRQ handling are now inheriting the
InterruptHandler class.

In addition to that, the initialization process of PATAChannel was
changed to fit the changes.
PATAChannel, E1000NetworkAdapter and RTL8139NetworkAdapter are now
inheriting from PCI::Device instead of InterruptHandler directly.
This commit is contained in:
Liav A 2020-01-21 13:23:03 +02:00 committed by Andreas Kling
commit 6c72736b26
Notes: sideshowbarker 2024-07-19 09:53:53 +09:00
29 changed files with 193 additions and 169 deletions

View file

@ -74,7 +74,7 @@ void SB16::set_sample_rate(uint16_t hz)
static SB16* s_the;
SB16::SB16()
: IRQHandler(5)
: InterruptHandler(5)
, CharacterDevice(42, 42) // ### ?
{
s_the = this;
@ -92,7 +92,7 @@ SB16& SB16::the()
void SB16::initialize()
{
disable_irq();
disable_interrupts();
IO::out8(0x226, 1);
IO::delay();
@ -153,7 +153,7 @@ void SB16::dma_start(uint32_t length)
IO::out8(0xd4, (channel % 4));
}
void SB16::handle_irq()
void SB16::handle_interrupt()
{
// Stop sound output ready for the next block.
dsp_write(0xd5);
@ -168,9 +168,8 @@ void SB16::handle_irq()
void SB16::wait_for_irq()
{
cli();
enable_irq();
InterruptHandler::Enabler enabler(*this);
current->wait_on(m_irq_queue);
disable_irq();
}
ssize_t SB16::write(FileDescription&, const u8* data, ssize_t length)