当前位置: 技术问答>linux和unix
x86 arch的boot_cpu_id变量是如何初始化的
来源: 互联网 发布时间:2016-10-06
本文导语: 全部source tree的搜索结果如下: [richard@PerfectLinux linux-2.6.35-rc2]$ find -type f|xargs grep "boot_cpu_id" -wn ./arch/alpha/kernel/smp.c:636: if (hard_smp_processor_id() != boot_cpu_id) ./arch/ia64/kernel/smpboot.c:579: int boot_cpu_id = har...
全部source tree的搜索结果如下:
[richard@PerfectLinux linux-2.6.35-rc2]$ find -type f|xargs grep "boot_cpu_id" -wn
./arch/alpha/kernel/smp.c:636: if (hard_smp_processor_id() != boot_cpu_id)
./arch/ia64/kernel/smpboot.c:579: int boot_cpu_id = hard_smp_processor_id();
./arch/ia64/kernel/smpboot.c:585: ia64_cpu_to_sapicid[0] = boot_cpu_id;
./arch/ia64/kernel/smpboot.c:591: if (sapicid == boot_cpu_id)
./arch/ia64/kernel/smpboot.c:606: int boot_cpu_id = hard_smp_processor_id();
./arch/ia64/kernel/smpboot.c:621: ia64_cpu_to_sapicid[0] = boot_cpu_id;
./arch/ia64/kernel/smpboot.c:623: printk(KERN_INFO "Boot processor id 0x%x/0x%xn", 0, boot_cpu_id);
./arch/sparc/include/asm/smp_32.h:31:extern unsigned char boot_cpu_id;
./arch/sparc/include/asm/smp_32.h:135: "sethi %%hi(boot_cpu_id), %0nt"
./arch/sparc/include/asm/smp_32.h:136: "ldub [%0 + %%lo(boot_cpu_id)], %0nt" :
./arch/sparc/kernel/head_32.S:820: sethi %hi(boot_cpu_id), %g1 ! master always 0
./arch/sparc/kernel/head_32.S:821: stb %g0, [%g1 + %lo(boot_cpu_id)]
./arch/sparc/kernel/head_32.S:895: sethi %hi(boot_cpu_id), %g5
./arch/sparc/kernel/head_32.S:896: stb %g4, [%g5 + %lo(boot_cpu_id)]
./arch/sparc/kernel/head_32.S:1029: * But first make current_set[boot_cpu_id] point to something useful.
./arch/sparc/kernel/leon_smp.c:52:extern unsigned char boot_cpu_id;
./arch/sparc/kernel/smp_32.c:40:unsigned char boot_cpu_id = 0;
./arch/sparc/kernel/smp_32.c:41:unsigned char boot_cpu_id4 = 0; /* boot_cpu_id cpu_index = boot_cpu_id;
./arch/x86/kernel/cpu/common.c:1258: if (smp_processor_id() == boot_cpu_id)
./arch/x86/kernel/cpu/intel.c:172: if (c->cpu_index == boot_cpu_id)
./arch/x86/kernel/reboot.c:87: have set up boot_cpu_id or smp_num_cpu */
./arch/x86/kernel/setup.c:127:unsigned int boot_cpu_id __read_mostly;
./arch/x86/kernel/setup_percpu.c:247: if (cpu == boot_cpu_id)
./arch/x86/kernel/setup_percpu.c:265: set_cpu_numa_node(boot_cpu_id, early_cpu_to_node(boot_cpu_id));
./arch/x86/mm/k8topology_64.c:57: * need to get boot_cpu_id so can use that to create apicid_to_node
./arch/x86/mm/k8topology_64.c:215: /* need to get boot_cpu_id early for system with apicid lifting */
[richard@PerfectLinux linux-2.6.35-rc2]$
就是看不到赋值的地方,很奇怪呀!
[richard@PerfectLinux linux-2.6.35-rc2]$ find -type f|xargs grep "boot_cpu_id" -wn
./arch/alpha/kernel/smp.c:636: if (hard_smp_processor_id() != boot_cpu_id)
./arch/ia64/kernel/smpboot.c:579: int boot_cpu_id = hard_smp_processor_id();
./arch/ia64/kernel/smpboot.c:585: ia64_cpu_to_sapicid[0] = boot_cpu_id;
./arch/ia64/kernel/smpboot.c:591: if (sapicid == boot_cpu_id)
./arch/ia64/kernel/smpboot.c:606: int boot_cpu_id = hard_smp_processor_id();
./arch/ia64/kernel/smpboot.c:621: ia64_cpu_to_sapicid[0] = boot_cpu_id;
./arch/ia64/kernel/smpboot.c:623: printk(KERN_INFO "Boot processor id 0x%x/0x%xn", 0, boot_cpu_id);
./arch/sparc/include/asm/smp_32.h:31:extern unsigned char boot_cpu_id;
./arch/sparc/include/asm/smp_32.h:135: "sethi %%hi(boot_cpu_id), %0nt"
./arch/sparc/include/asm/smp_32.h:136: "ldub [%0 + %%lo(boot_cpu_id)], %0nt" :
./arch/sparc/kernel/head_32.S:820: sethi %hi(boot_cpu_id), %g1 ! master always 0
./arch/sparc/kernel/head_32.S:821: stb %g0, [%g1 + %lo(boot_cpu_id)]
./arch/sparc/kernel/head_32.S:895: sethi %hi(boot_cpu_id), %g5
./arch/sparc/kernel/head_32.S:896: stb %g4, [%g5 + %lo(boot_cpu_id)]
./arch/sparc/kernel/head_32.S:1029: * But first make current_set[boot_cpu_id] point to something useful.
./arch/sparc/kernel/leon_smp.c:52:extern unsigned char boot_cpu_id;
./arch/sparc/kernel/smp_32.c:40:unsigned char boot_cpu_id = 0;
./arch/sparc/kernel/smp_32.c:41:unsigned char boot_cpu_id4 = 0; /* boot_cpu_id cpu_index = boot_cpu_id;
./arch/x86/kernel/cpu/common.c:1258: if (smp_processor_id() == boot_cpu_id)
./arch/x86/kernel/cpu/intel.c:172: if (c->cpu_index == boot_cpu_id)
./arch/x86/kernel/reboot.c:87: have set up boot_cpu_id or smp_num_cpu */
./arch/x86/kernel/setup.c:127:unsigned int boot_cpu_id __read_mostly;
./arch/x86/kernel/setup_percpu.c:247: if (cpu == boot_cpu_id)
./arch/x86/kernel/setup_percpu.c:265: set_cpu_numa_node(boot_cpu_id, early_cpu_to_node(boot_cpu_id));
./arch/x86/mm/k8topology_64.c:57: * need to get boot_cpu_id so can use that to create apicid_to_node
./arch/x86/mm/k8topology_64.c:215: /* need to get boot_cpu_id early for system with apicid lifting */
[richard@PerfectLinux linux-2.6.35-rc2]$
就是看不到赋值的地方,很奇怪呀!
|
我只能够猜测.data.read_mostly段 会全部被初始化为0
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。