hpsim_irq.c 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Platform dependent support for HP simulator.
  3. *
  4. * Copyright (C) 1998-2001 Hewlett-Packard Co
  5. * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
  6. */
  7. #include <linux/init.h>
  8. #include <linux/kernel.h>
  9. #include <linux/sched.h>
  10. #include <linux/irq.h>
  11. static unsigned int
  12. hpsim_irq_startup(struct irq_data *data)
  13. {
  14. return 0;
  15. }
  16. static void
  17. hpsim_irq_noop(struct irq_data *data)
  18. {
  19. }
  20. static int
  21. hpsim_set_affinity_noop(struct irq_data *d, const struct cpumask *b, bool f)
  22. {
  23. return 0;
  24. }
  25. static struct irq_chip irq_type_hp_sim = {
  26. .name = "hpsim",
  27. .irq_startup = hpsim_irq_startup,
  28. .irq_shutdown = hpsim_irq_noop,
  29. .irq_enable = hpsim_irq_noop,
  30. .irq_disable = hpsim_irq_noop,
  31. .irq_ack = hpsim_irq_noop,
  32. .irq_set_affinity = hpsim_set_affinity_noop,
  33. };
  34. void __init
  35. hpsim_irq_init (void)
  36. {
  37. struct irq_desc *idesc;
  38. int i;
  39. for (i = 0; i < NR_IRQS; ++i) {
  40. idesc = irq_desc + i;
  41. if (idesc->chip == &no_irq_chip)
  42. idesc->chip = &irq_type_hp_sim;
  43. }
  44. }