dummychip.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
  3. * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
  4. *
  5. * This file contains the dummy interrupt chip implementation
  6. */
  7. #include <linux/interrupt.h>
  8. #include <linux/irq.h>
  9. #include "internals.h"
  10. /*
  11. * What should we do if we get a hw irq event on an illegal vector?
  12. * Each architecture has to answer this themself.
  13. */
  14. static void ack_bad(struct irq_data *data)
  15. {
  16. struct irq_desc *desc = irq_data_to_desc(data);
  17. print_irq_desc(data->irq, desc);
  18. ack_bad_irq(data->irq);
  19. }
  20. /*
  21. * NOP functions
  22. */
  23. static void noop(struct irq_data *data) { }
  24. static unsigned int noop_ret(struct irq_data *data)
  25. {
  26. return 0;
  27. }
  28. #ifndef CONFIG_GENERIC_HARDIRQS_NO_CRUFT
  29. static void compat_noop(unsigned int irq) { }
  30. #define END_INIT .end = compat_noop
  31. #else
  32. #define END_INIT
  33. #endif
  34. /*
  35. * Generic no controller implementation
  36. */
  37. struct irq_chip no_irq_chip = {
  38. .name = "none",
  39. .irq_startup = noop_ret,
  40. .irq_shutdown = noop,
  41. .irq_enable = noop,
  42. .irq_disable = noop,
  43. .irq_ack = ack_bad,
  44. END_INIT
  45. };
  46. /*
  47. * Generic dummy implementation which can be used for
  48. * real dumb interrupt sources
  49. */
  50. struct irq_chip dummy_irq_chip = {
  51. .name = "dummy",
  52. .irq_startup = noop_ret,
  53. .irq_shutdown = noop,
  54. .irq_enable = noop,
  55. .irq_disable = noop,
  56. .irq_ack = noop,
  57. .irq_mask = noop,
  58. .irq_unmask = noop,
  59. END_INIT
  60. };