免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1339 | 回复: 0

[其他] 有关__switch_data的一个问题 [复制链接]

论坛徽章:
0
发表于 2013-06-20 10:17 |显示全部楼层

17         .type   __switch_data, %object
18 __switch_data:
19         .long   __mmap_switched
20         .long   __data_loc                      @ r4
21         .long   _data                           @ r5

22         .long   __bss_start                     @ r6
23         .long   _end                            @ r7
24         .long   processor_id                    @ r4
25         .long   __machine_arch_type             @ r5
26         .long   __atags_pointer                 @ r6
27         .long   cr_alignment                    @ r7
28         .long   init_thread_union + THREAD_START_SP @ sp
29
30 /*      
31  * The following fragment of code is executed with the MMU on in MMU mode,
32  * and uses absolute addresses; this is not position independent.
33  *              
34  *  r0  = cp#15 control register
35  *  r1  = machine ID
36  *  r2  = atags pointer
37  *  r9  = processor ID
38  */
39 __mmap_switched:
40         adr     r3, __switch_data + 4
41                 
42         ldmia   r3!, {r4, r5, r6, r7}
43         cmp     r4, r5                          @ Copy data segment if needed
44 1:      cmpne   r5, r6

45         ldrne   fp, [r4], #4
46         strne   fp, [r5], #4
47         bne     1b
48                 
49         mov     fp, #0                          @ Clear BSS (and zero fp)
50 1:      cmp     r6, r7
51         strcc   fp, [r6],#4
52         bcc     1b

这里我无法理解  我觉得根据链接脚本

134 #ifdef CONFIG_XIP_KERNEL
135         __data_loc = ALIGN(4);          /* location in binary */
136         . = PAGE_OFFSET + TEXT_OFFSET;
137 #else
138         . = ALIGN(THREAD_SIZE);
139         __data_loc = .;
140 #endif
141
142         .data : AT(__data_loc) {
143                 _data = .;              /* address in memory */

144
145                 /*

__data_loc和_data应该是一样的,  为啥会有不同呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP