1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

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
parent 1ee37245cd
commit 6c72736b26
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)