FreeBSD/sys/x86/x86/intr_machdep.c
/*
 * Return the CPU that the next interrupt source should use.  For now
 * this just returns the next local APIC according to round-robin.
 */
Return the CPU that the next interrupt source should use.  For now
this just returns the next local APIC according to round-robin.
Return the CPU that the next interrupt source should use . For now this just returns the next local APIC according to round - robin .
u_int
intr_next_cpu(void)
{
	u_int apic_id;
#ifdef EARLY_AP_STARTUP
	MPASS(mp_ncpus == 1 || smp_started);
#else
	if (!assign_cpu)
		return (PCPU_GET(apic_id));
#endif
	mtx_lock_spin(&icu_lock);
	apic_id = cpu_apic_ids[current_cpu];
	do {
		current_cpu++;
		if (current_cpu > mp_maxid)
			current_cpu = 0;
	} while (!CPU_ISSET(current_cpu, &intr_cpus));
	mtx_unlock_spin(&icu_lock);
	return (apic_id);
}
u_int intr_next_cpu ( void ) { u_int apic_id ; #ifdef EARLY_AP_STARTUP MPASS ( mp_ncpus == 1 || smp_started ) ; #else if ( ! assign_cpu ) return ( PCPU_GET ( apic_id ) ) ; #endif mtx_lock_spin ( & icu_lock ) ; apic_id = cpu_apic_ids [ current_cpu ] ; do { current_cpu ++ ; if ( current_cpu > mp_maxid ) current_cpu = 0 ; } while ( ! CPU_ISSET ( current_cpu , & intr_cpus ) ) ; mtx_unlock_spin ( & icu_lock ) ; return ( apic_id ) ; }
Return the CPU that the next interrupt source should use.
Return the CPU that the next interrupt source should use .
/* Leave all interrupts on the BSP during boot. */