dummychip.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. /*
  29. * Generic no controller implementation
  30. */
  31. struct irq_chip no_irq_chip = {
  32. .name = "none",
  33. .irq_startup = noop_ret,
  34. .irq_shutdown = noop,
  35. .irq_enable = noop,
  36. .irq_disable = noop,
  37. .irq_ack = ack_bad,
  38. };
  39. /*
  40. * Generic dummy implementation which can be used for
  41. * real dumb interrupt sources
  42. */
  43. struct irq_chip dummy_irq_chip = {
  44. .name = "dummy",
  45. .irq_startup = noop_ret,
  46. .irq_shutdown = noop,
  47. .irq_enable = noop,
  48. .irq_disable = noop,
  49. .irq_ack = noop,
  50. .irq_mask = noop,
  51. .irq_unmask = noop,
  52. };