irq.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
  3. * Copyright (C) 2007-2009 PetaLogix
  4. * Copyright (C) 2006 Atmark Techno, Inc.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/ftrace.h>
  12. #include <linux/kernel.h>
  13. #include <linux/hardirq.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/irqflags.h>
  16. #include <linux/seq_file.h>
  17. #include <linux/kernel_stat.h>
  18. #include <linux/irq.h>
  19. #include <linux/irqchip.h>
  20. #include <linux/of_irq.h>
  21. static u32 concurrent_irq;
  22. void __irq_entry do_IRQ(struct pt_regs *regs)
  23. {
  24. unsigned int irq;
  25. struct pt_regs *old_regs = set_irq_regs(regs);
  26. trace_hardirqs_off();
  27. irq_enter();
  28. irq = get_irq();
  29. next_irq:
  30. BUG_ON(!irq);
  31. generic_handle_irq(irq);
  32. irq = get_irq();
  33. if (irq != -1U) {
  34. pr_debug("next irq: %d\n", irq);
  35. ++concurrent_irq;
  36. goto next_irq;
  37. }
  38. irq_exit();
  39. set_irq_regs(old_regs);
  40. trace_hardirqs_on();
  41. }
  42. void __init init_IRQ(void)
  43. {
  44. /* process the entire interrupt tree in one go */
  45. irqchip_init();
  46. }