irq_work.c 932 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * x86 specific code for irq_work
  3. *
  4. * Copyright (C) 2010 Red Hat, Inc., Peter Zijlstra
  5. */
  6. #include <linux/kernel.h>
  7. #include <linux/irq_work.h>
  8. #include <linux/hardirq.h>
  9. #include <asm/apic.h>
  10. #include <asm/trace/irq_vectors.h>
  11. #include <linux/interrupt.h>
  12. static inline void __smp_irq_work_interrupt(void)
  13. {
  14. inc_irq_stat(apic_irq_work_irqs);
  15. irq_work_run();
  16. }
  17. __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs)
  18. {
  19. ipi_entering_ack_irq();
  20. __smp_irq_work_interrupt();
  21. exiting_irq();
  22. }
  23. __visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs)
  24. {
  25. ipi_entering_ack_irq();
  26. trace_irq_work_entry(IRQ_WORK_VECTOR);
  27. __smp_irq_work_interrupt();
  28. trace_irq_work_exit(IRQ_WORK_VECTOR);
  29. exiting_irq();
  30. }
  31. void arch_irq_work_raise(void)
  32. {
  33. #ifdef CONFIG_X86_LOCAL_APIC
  34. if (!arch_irq_work_has_interrupt())
  35. return;
  36. apic->send_IPI_self(IRQ_WORK_VECTOR);
  37. apic_wait_icr_idle();
  38. #endif
  39. }