irq.c 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * OpenRISC irq.c
  4. *
  5. * Linux architectural port borrowing liberally from similar works of
  6. * others. All original copyrights apply as per the original source
  7. * declaration.
  8. *
  9. * Modifications for the OpenRISC architecture:
  10. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  11. */
  12. #include <linux/interrupt.h>
  13. #include <linux/init.h>
  14. #include <linux/ftrace.h>
  15. #include <linux/irq.h>
  16. #include <linux/irqchip.h>
  17. #include <linux/export.h>
  18. #include <linux/irqflags.h>
  19. /* read interrupt enabled status */
  20. unsigned long arch_local_save_flags(void)
  21. {
  22. return mfspr(SPR_SR) & (SPR_SR_IEE|SPR_SR_TEE);
  23. }
  24. EXPORT_SYMBOL(arch_local_save_flags);
  25. /* set interrupt enabled status */
  26. void arch_local_irq_restore(unsigned long flags)
  27. {
  28. mtspr(SPR_SR, ((mfspr(SPR_SR) & ~(SPR_SR_IEE|SPR_SR_TEE)) | flags));
  29. }
  30. EXPORT_SYMBOL(arch_local_irq_restore);
  31. void __init init_IRQ(void)
  32. {
  33. irqchip_init();
  34. }
  35. void __irq_entry do_IRQ(struct pt_regs *regs)
  36. {
  37. handle_arch_irq(regs);
  38. }