mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
Kernel: Use a WaitQueue in PATAChannel
Instead of waking up repeatedly to check if a disk operation has finished, use a WaitQueue and wake it up in the IRQ handler. This simplifies the device driver a bit, and makes it more responsive as well :^)
This commit is contained in:
parent
9ed272ce98
commit
8b129476b1
3 changed files with 17 additions and 40 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <Kernel/PCI.h>
|
||||
#include <Kernel/VM/PhysicalAddress.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
|
||||
struct PhysicalRegionDescriptor {
|
||||
PhysicalAddress offset;
|
||||
|
@ -49,7 +50,7 @@ private:
|
|||
void initialize(bool force_pio);
|
||||
void detect_disks();
|
||||
|
||||
bool wait_for_irq();
|
||||
void wait_for_irq();
|
||||
bool ata_read_sectors_with_dma(u32, u16, u8*, bool);
|
||||
bool ata_write_sectors_with_dma(u32, u16, const u8*, bool);
|
||||
bool ata_read_sectors(u32, u16, u8*, bool);
|
||||
|
@ -60,7 +61,8 @@ private:
|
|||
u16 m_io_base { 0x1F0 };
|
||||
u16 m_control_base { 0 };
|
||||
volatile u8 m_device_error { 0 };
|
||||
volatile bool m_interrupted { false };
|
||||
|
||||
WaitQueue m_irq_queue;
|
||||
|
||||
PCI::Address m_pci_address;
|
||||
PhysicalRegionDescriptor m_prdt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue