Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30437
b: refs/heads/master
c: 3505599
h: refs/heads/master
i:
  30435: b7893c5
v: v3
  • Loading branch information
David S. Miller committed Jun 26, 2006
1 parent a0c0094 commit 7bc8429
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 63 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 698539187aee83ea6843e29875dde70b473f8bc1
refs/heads/master: 350559961593a9680244b22b32733a49e21f25d6
61 changes: 0 additions & 61 deletions trunk/arch/sparc64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,67 +563,6 @@ void handler_irq(int irq, struct pt_regs *regs)
irq_exit();
}

#ifdef CONFIG_BLK_DEV_FD
extern irqreturn_t floppy_interrupt(int, void *, struct pt_regs *);

/* XXX No easy way to include asm/floppy.h XXX */
extern unsigned char *pdma_vaddr;
extern unsigned long pdma_size;
extern volatile int doing_pdma;
extern unsigned long fdc_status;

irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
{
if (likely(doing_pdma)) {
void __iomem *stat = (void __iomem *) fdc_status;
unsigned char *vaddr = pdma_vaddr;
unsigned long size = pdma_size;
u8 val;

while (size) {
val = readb(stat);
if (unlikely(!(val & 0x80))) {
pdma_vaddr = vaddr;
pdma_size = size;
return IRQ_HANDLED;
}
if (unlikely(!(val & 0x20))) {
pdma_vaddr = vaddr;
pdma_size = size;
doing_pdma = 0;
goto main_interrupt;
}
if (val & 0x40) {
/* read */
*vaddr++ = readb(stat + 1);
} else {
unsigned char data = *vaddr++;

/* write */
writeb(data, stat + 1);
}
size--;
}

pdma_vaddr = vaddr;
pdma_size = size;

/* Send Terminal Count pulse to floppy controller. */
val = readb(auxio_register);
val |= AUXIO_AUX1_FTCNT;
writeb(val, auxio_register);
val &= ~AUXIO_AUX1_FTCNT;
writeb(val, auxio_register);

doing_pdma = 0;
}

main_interrupt:
return floppy_interrupt(irq, dev_cookie, regs);
}
EXPORT_SYMBOL(sparc_floppy_irq);
#endif

struct sun5_timer {
u64 count0;
u64 limit0;
Expand Down
50 changes: 49 additions & 1 deletion trunk/include/asm-sparc64/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,55 @@ static void sun_fd_enable_dma(void)
pdma_areasize = pdma_size;
}

extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *);
irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
{
if (likely(doing_pdma)) {
void __iomem *stat = (void __iomem *) fdc_status;
unsigned char *vaddr = pdma_vaddr;
unsigned long size = pdma_size;
u8 val;

while (size) {
val = readb(stat);
if (unlikely(!(val & 0x80))) {
pdma_vaddr = vaddr;
pdma_size = size;
return IRQ_HANDLED;
}
if (unlikely(!(val & 0x20))) {
pdma_vaddr = vaddr;
pdma_size = size;
doing_pdma = 0;
goto main_interrupt;
}
if (val & 0x40) {
/* read */
*vaddr++ = readb(stat + 1);
} else {
unsigned char data = *vaddr++;

/* write */
writeb(data, stat + 1);
}
size--;
}

pdma_vaddr = vaddr;
pdma_size = size;

/* Send Terminal Count pulse to floppy controller. */
val = readb(auxio_register);
val |= AUXIO_AUX1_FTCNT;
writeb(val, auxio_register);
val &= ~AUXIO_AUX1_FTCNT;
writeb(val, auxio_register);

doing_pdma = 0;
}

main_interrupt:
return floppy_interrupt(irq, dev_cookie, regs);
}

static int sun_fd_request_irq(void)
{
Expand Down

0 comments on commit 7bc8429

Please sign in to comment.