IPI

arch_send_call_function_single_ipi


126 void native_send_call_func_single_ipi(int cpu)
127 {  
128     apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
129 }  
130 


104 void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)

105 {
106     unsigned long mask = cpumask_bits(cpumask)[0];
107     unsigned long flags;
108 
109     if (WARN_ONCE(!mask, "empty IPI mask"))
110         return;
111 
112     local_irq_save(flags);
113     WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
114     __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
115     local_irq_restore(flags);
116 }

 92 static inline void
 93  __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest)
 94 {
 95     unsigned long cfg;
 96 
 97     /*
 98      * Wait for idle.
 99      */
100     if (unlikely(vector == NMI_VECTOR))
101         safe_apic_wait_icr_idle();
102     else
103         __xapic_wait_icr_idle();
104 
105     /*
106      * prepare target chip field
107      */
108     cfg = __prepare_ICR2(mask);    
109     native_apic_mem_write(APIC_ICR2, cfg);
110 
111     /*
112      * program the ICR
113      */
114     cfg = __prepare_ICR(0, vector, dest);
115 
116     /*
117      * Send the IPI. The write to APIC_ICR fires this off.
118      */
119     native_apic_mem_write(APIC_ICR, cfg);
120 }

你可能感兴趣的:(IPI)