天嵌 ARM开发社区

 找回密码
 注册
查看: 1948|回复: 0

关于uboot1.1.16源码中重定位部分计算armboot size和清除BSS的疑问

[复制链接]
chenaiyuxue 发表于 2014-7-16 13:58:07 | 显示全部楼层 |阅读模式
5
#ifndef CONFIG_SKIP_RELOCATE_UBOOT
relocate:                                /* relocate U-Boot to RAM            */
        adr        r0, _start                /* r0 <- current position of code   */
        ldr        r1, _TEXT_BASE                /* test if we run from flash or RAM */
        cmp     r0, r1                  /* don't reloc during debug         */
        beq     clear_bss

        ldr        r2, _armboot_start                                  (1)
        ldr        r3, _bss_start                                           (2)
        sub        r2, r3, r2                /* r2 <- size of armboot            */
#if 1
        bl  CopyCode2Ram                /* r0: source, r1: dest, r2: size */
#else
        add        r2, r0, r2                /* r2 <- source end address         */

copy_loop:
        ldmia        r0!, {r3-r10}                /* copy from source address [r0]    */
        stmia        r1!, {r3-r10}                /* copy to   target address [r1]    */
        cmp        r0, r2                        /* until source end addreee [r2]    */
        ble        copy_loop
#endif
#endif        /* CONFIG_SKIP_RELOCATE_UBOOT */

clear_bss:
        ldr        r0, _bss_start                   (3)            /* find start of bss segment        */
        ldr        r1, _bss_end                     (4)                /* stop here                        */
        mov         r2, #0x00000000                /* clear                            */
问题1:    以上(1)位置处的_armboot_start的值是0还是Config.mk中指定的0x33D00000,为什么?
问题2:   (2)位置处和(3)位置处的_bss_start的值是相同的吗?

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-7 05:46 , Processed in 1.015625 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表