- 论坛徽章:
- 0
|
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应该是一样的, 为啥会有不同呢? |
|