1e360adbeSPeter Zijlstra /* 2e360adbeSPeter Zijlstra * x86 specific code for irq_work 3e360adbeSPeter Zijlstra * 490eec103SPeter Zijlstra * Copyright (C) 2010 Red Hat, Inc., Peter Zijlstra 5e360adbeSPeter Zijlstra */ 6e360adbeSPeter Zijlstra 7e360adbeSPeter Zijlstra #include <linux/kernel.h> 8e360adbeSPeter Zijlstra #include <linux/irq_work.h> 9e360adbeSPeter Zijlstra #include <linux/hardirq.h> 10e360adbeSPeter Zijlstra #include <asm/apic.h> 11cf910e83SSeiji Aguchi #include <asm/trace/irq_vectors.h> 12e360adbeSPeter Zijlstra 13eddc0e92SSeiji Aguchi static inline void __smp_irq_work_interrupt(void) 14eddc0e92SSeiji Aguchi { 15e360adbeSPeter Zijlstra inc_irq_stat(apic_irq_work_irqs); 16e360adbeSPeter Zijlstra irq_work_run(); 17eddc0e92SSeiji Aguchi } 18eddc0e92SSeiji Aguchi 191d9090e2SAndi Kleen __visible void smp_irq_work_interrupt(struct pt_regs *regs) 20eddc0e92SSeiji Aguchi { 216dc17876SThomas Gleixner ipi_entering_ack_irq(); 22eddc0e92SSeiji Aguchi __smp_irq_work_interrupt(); 23eddc0e92SSeiji Aguchi exiting_irq(); 24e360adbeSPeter Zijlstra } 25e360adbeSPeter Zijlstra 261d9090e2SAndi Kleen __visible void smp_trace_irq_work_interrupt(struct pt_regs *regs) 27cf910e83SSeiji Aguchi { 286dc17876SThomas Gleixner ipi_entering_ack_irq(); 29cf910e83SSeiji Aguchi trace_irq_work_entry(IRQ_WORK_VECTOR); 30cf910e83SSeiji Aguchi __smp_irq_work_interrupt(); 31cf910e83SSeiji Aguchi trace_irq_work_exit(IRQ_WORK_VECTOR); 32cf910e83SSeiji Aguchi exiting_irq(); 33cf910e83SSeiji Aguchi } 34cf910e83SSeiji Aguchi 35e360adbeSPeter Zijlstra void arch_irq_work_raise(void) 36e360adbeSPeter Zijlstra { 37e360adbeSPeter Zijlstra #ifdef CONFIG_X86_LOCAL_APIC 383010279fSFrederic Weisbecker if (!arch_irq_work_has_interrupt()) 39e360adbeSPeter Zijlstra return; 40e360adbeSPeter Zijlstra 41e360adbeSPeter Zijlstra apic->send_IPI_self(IRQ_WORK_VECTOR); 42e360adbeSPeter Zijlstra apic_wait_icr_idle(); 43e360adbeSPeter Zijlstra #endif 44e360adbeSPeter Zijlstra } 45