irq.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * OpenRISC irq.c
  3. *
  4. * Linux architectural port borrowing liberally from similar works of
  5. * others. All original copyrights apply as per the original source
  6. * declaration.
  7. *
  8. * Modifications for the OpenRISC architecture:
  9. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. */
  16. #include <linux/interrupt.h>
  17. #include <linux/init.h>
  18. #include <linux/ftrace.h>
  19. #include <linux/irq.h>
  20. #include <linux/irqchip.h>
  21. #include <linux/export.h>
  22. #include <linux/irqflags.h>
  23. /* read interrupt enabled status */
  24. unsigned long arch_local_save_flags(void)
  25. {
  26. return mfspr(SPR_SR) & (SPR_SR_IEE|SPR_SR_TEE);
  27. }
  28. EXPORT_SYMBOL(arch_local_save_flags);
  29. /* set interrupt enabled status */
  30. void arch_local_irq_restore(unsigned long flags)
  31. {
  32. mtspr(SPR_SR, ((mfspr(SPR_SR) & ~(SPR_SR_IEE|SPR_SR_TEE)) | flags));
  33. }
  34. EXPORT_SYMBOL(arch_local_irq_restore);
  35. void __init init_IRQ(void)
  36. {
  37. irqchip_init();
  38. }
  39. static void (*handle_arch_irq)(struct pt_regs *);
  40. void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
  41. {
  42. handle_arch_irq = handle_irq;
  43. }
  44. void __irq_entry do_IRQ(struct pt_regs *regs)
  45. {
  46. handle_arch_irq(regs);
  47. }