Commit 38ede908 authored by Willy Tarreau's avatar Willy Tarreau Committed by Denis Efremov

floppy: use symbolic register names in the x86 port

Now we can use FD_STATUS and FD_DATA instead of 4 or 5, let's do
this, and also use STATUS_DMA and STATUS_READY for the status bits.

Link: https://lore.kernel.org/r/20200331094054.24441-9-w@1wt.eu
Cc: x86@kernel.org
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarDenis Efremov <efremov@linux.com>
parent 6cb7e696
...@@ -77,25 +77,26 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id) ...@@ -77,25 +77,26 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
st = 1; st = 1;
for (lcount = virtual_dma_count, lptr = virtual_dma_addr; for (lcount = virtual_dma_count, lptr = virtual_dma_addr;
lcount; lcount--, lptr++) { lcount; lcount--, lptr++) {
st = inb(virtual_dma_port + 4) & 0xa0; st = inb(virtual_dma_port + FD_STATUS);
if (st != 0xa0) st &= STATUS_DMA | STATUS_READY;
if (st != (STATUS_DMA | STATUS_READY))
break; break;
if (virtual_dma_mode) if (virtual_dma_mode)
outb_p(*lptr, virtual_dma_port + 5); outb_p(*lptr, virtual_dma_port + FD_DATA);
else else
*lptr = inb_p(virtual_dma_port + 5); *lptr = inb_p(virtual_dma_port + FD_DATA);
} }
virtual_dma_count = lcount; virtual_dma_count = lcount;
virtual_dma_addr = lptr; virtual_dma_addr = lptr;
st = inb(virtual_dma_port + 4); st = inb(virtual_dma_port + FD_STATUS);
} }
#ifdef TRACE_FLPY_INT #ifdef TRACE_FLPY_INT
calls++; calls++;
#endif #endif
if (st == 0x20) if (st == STATUS_DMA)
return IRQ_HANDLED; return IRQ_HANDLED;
if (!(st & 0x20)) { if (!(st & STATUS_DMA)) {
virtual_dma_residue += virtual_dma_count; virtual_dma_residue += virtual_dma_count;
virtual_dma_count = 0; virtual_dma_count = 0;
#ifdef TRACE_FLPY_INT #ifdef TRACE_FLPY_INT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment