继续回到start_kernel,来到函数boot_cpu_init();定位到该函数
static void __init boot_cpu_init(void)
{
int cpu = smp_processor_id();
/* Mark the boot cpu "present", "online" etc for SMP and UP case */
set_cpu_online(cpu, true);
set_cpu_active(cpu, true);
set_cpu_present(cpu, true);
set_cpu_possible(cpu, true);
}
首先来看函数smp_processor_id(),定位到该函数
#ifdef CONFIG_DEBUG_PREEMPT
extern unsigned int debug_smp_processor_id(void);
# define smp_processor_id() debug_smp_processor_id()
#else
# define smp_processor_id() raw_smp_processor_id()
#endif
由于没有定义宏CONFIG_DEBUG_PREEMPT,所以最终调用的就是 raw_smp_processor_id(),定位到该函数