interrupt.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /***************************************************************************
  2. nec7210/interrupt.c
  3. -------------------
  4. begin : Dec 2001
  5. copyright : (C) 2001, 2002 by Frank Mori Hess
  6. email : fmhess@users.sourceforge.net
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #include "pc2.h"
  17. #include <asm/bitops.h>
  18. #include <asm/dma.h>
  19. /*
  20. * GPIB interrupt service routines
  21. */
  22. irqreturn_t pc2_interrupt(int irq, void *arg PT_REGS_ARG)
  23. {
  24. gpib_board_t *board = arg;
  25. pc2_private_t *priv = board->private_data;
  26. unsigned long flags;
  27. irqreturn_t retval;
  28. spin_lock_irqsave( &board->spinlock, flags );
  29. retval = nec7210_interrupt(board, &priv->nec7210_priv);
  30. spin_unlock_irqrestore( &board->spinlock, flags );
  31. return retval;
  32. }
  33. irqreturn_t pc2a_interrupt(int irq, void *arg PT_REGS_ARG)
  34. {
  35. gpib_board_t *board = arg;
  36. pc2_private_t *priv = board->private_data;
  37. int status1, status2;
  38. unsigned long flags;
  39. irqreturn_t retval;
  40. spin_lock_irqsave( &board->spinlock, flags );
  41. // read interrupt status (also clears status)
  42. status1 = read_byte( &priv->nec7210_priv, ISR1 );
  43. status2 = read_byte( &priv->nec7210_priv, ISR2 );
  44. /* clear interrupt circuit */
  45. if(priv->irq)
  46. outb(0xff , CLEAR_INTR_REG(priv->irq) );
  47. retval = nec7210_interrupt_have_status( board, &priv->nec7210_priv, status1, status2 );
  48. spin_unlock_irqrestore( &board->spinlock, flags );
  49. return retval;
  50. }