FreeBSD/sys/x86/x86/mp_x86.c
/*
 * Send an IPI to specified CPU handling the bitmap logic.
 */
Send an IPI to specified CPU handling the bitmap logic.
Send an IPI to specified CPU handling the bitmap logic .
void
ipi_send_cpu(int cpu, u_int ipi)
{
	u_int bitmap, old_pending, new_pending;
	KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
	if (IPI_IS_BITMAPED(ipi)) {
		bitmap = 1 << ipi;
		ipi = IPI_BITMAP_VECTOR;
		do {
			old_pending = cpu_ipi_pending[cpu];
			new_pending = old_pending | bitmap;
		} while  (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
		    old_pending, new_pending));	
		if (old_pending)
			return;
	}
	lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
}
void ipi_send_cpu ( int cpu , u_int ipi ) { u_int bitmap , old_pending , new_pending ; KASSERT ( cpu_apic_ids [ cpu ] != -1 , ( " " , cpu ) ) ; if ( IPI_IS_BITMAPED ( ipi ) ) { bitmap = 1 << ipi ; ipi = IPI_BITMAP_VECTOR ; do { old_pending = cpu_ipi_pending [ cpu ] ; new_pending = old_pending | bitmap ; } while ( ! atomic_cmpset_int ( & cpu_ipi_pending [ cpu ] , old_pending , new_pending ) ) ; if ( old_pending ) return ; } lapic_ipi_vectored ( ipi , cpu_apic_ids [ cpu ] ) ; }
Send an IPI to specified CPU handling the bitmap logic.
Send an IPI to specified CPU handling the bitmap logic .