/arch/m68k/apollo/dn_ints.c

https://bitbucket.org/thekraven/iscream_thunderc-2.6.35 · C · 44 lines · 36 code · 8 blank · 0 comment · 2 complexity · a653e659045e4190b1afb3879755ca62 MD5 · raw file

  1. #include <linux/interrupt.h>
  2. #include <asm/irq.h>
  3. #include <asm/traps.h>
  4. #include <asm/apollohw.h>
  5. void dn_process_int(unsigned int irq, struct pt_regs *fp)
  6. {
  7. __m68k_handle_int(irq, fp);
  8. *(volatile unsigned char *)(pica)=0x20;
  9. *(volatile unsigned char *)(picb)=0x20;
  10. }
  11. int apollo_irq_startup(unsigned int irq)
  12. {
  13. if (irq < 8)
  14. *(volatile unsigned char *)(pica+1) &= ~(1 << irq);
  15. else
  16. *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
  17. return 0;
  18. }
  19. void apollo_irq_shutdown(unsigned int irq)
  20. {
  21. if (irq < 8)
  22. *(volatile unsigned char *)(pica+1) |= (1 << irq);
  23. else
  24. *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
  25. }
  26. static struct irq_controller apollo_irq_controller = {
  27. .name = "apollo",
  28. .lock = __SPIN_LOCK_UNLOCKED(apollo_irq_controller.lock),
  29. .startup = apollo_irq_startup,
  30. .shutdown = apollo_irq_shutdown,
  31. };
  32. void __init dn_init_IRQ(void)
  33. {
  34. m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
  35. m68k_setup_irq_controller(&apollo_irq_controller, IRQ_APOLLO, 16);
  36. }