irq.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2012 Regents of the University of California
  3. * Copyright (C) 2017 SiFive
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation, version 2.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include <linux/interrupt.h>
  15. #include <linux/irqchip.h>
  16. #include <linux/irqdomain.h>
  17. #ifdef CONFIG_RISCV_INTC
  18. #include <linux/irqchip/irq-riscv-intc.h>
  19. #endif
  20. void __init init_IRQ(void)
  21. {
  22. irqchip_init();
  23. }
  24. asmlinkage void __irq_entry do_IRQ(unsigned int cause, struct pt_regs *regs)
  25. {
  26. #ifdef CONFIG_RISCV_INTC
  27. /*
  28. * FIXME: We don't want a direct call to riscv_intc_irq here. The plan
  29. * is to put an IRQ domain here and let the interrupt controller
  30. * register with that, but I poked around the arm64 code a bit and
  31. * there might be a better way to do it (ie, something fully generic).
  32. */
  33. riscv_intc_irq(cause, regs);
  34. #endif
  35. }