mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +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:
parent
1ee37245cd
commit
6c72736b26
29 changed files with 193 additions and 169 deletions
|
@ -38,9 +38,10 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <Kernel/IRQHandler.h>
|
||||
#include <Kernel/InterruptHandler.h>
|
||||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/PCI/Access.h>
|
||||
#include <Kernel/PCI/Device.h>
|
||||
#include <Kernel/VM/PhysicalAddress.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
|
@ -52,7 +53,7 @@ struct PhysicalRegionDescriptor {
|
|||
};
|
||||
|
||||
class PATADiskDevice;
|
||||
class PATAChannel final : public IRQHandler {
|
||||
class PATAChannel final : public PCI::Device {
|
||||
friend class PATADiskDevice;
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
|
@ -62,8 +63,8 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
static OwnPtr<PATAChannel> create(ChannelType type, bool force_pio);
|
||||
PATAChannel(ChannelType type, bool force_pio);
|
||||
static OwnPtr<PATAChannel> autodetect(ChannelType type, bool force_pio);
|
||||
PATAChannel(PCI::Address pci_address, ChannelType type, bool force_pio);
|
||||
virtual ~PATAChannel() override;
|
||||
|
||||
RefPtr<PATADiskDevice> master_device() { return m_master; };
|
||||
|
@ -71,7 +72,7 @@ public:
|
|||
|
||||
private:
|
||||
//^ IRQHandler
|
||||
virtual void handle_irq() override;
|
||||
virtual void handle_interrupt() override;
|
||||
|
||||
void initialize(bool force_pio);
|
||||
void detect_disks();
|
||||
|
@ -90,7 +91,6 @@ private:
|
|||
|
||||
WaitQueue m_irq_queue;
|
||||
|
||||
PCI::Address m_pci_address;
|
||||
PhysicalRegionDescriptor& prdt() { return *reinterpret_cast<PhysicalRegionDescriptor*>(m_prdt_page->paddr().offset(0xc0000000).as_ptr()); }
|
||||
RefPtr<PhysicalPage> m_prdt_page;
|
||||
RefPtr<PhysicalPage> m_dma_buffer_page;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue