.

.

.

common/board_r.c

1    static int initr_reloc_global_data(void)
2    {
3    #ifdef __ARM__
4            monitor_flash_len = _end - __image_copy_start;
5    #elif defined(CONFIG_NDS32)
6            monitor_flash_len = (ulong)&_end - (ulong)&_start;
7    #elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2)
8            monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
9    #endif
10    #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
11            /*
12             * The gd->cpu pointer is set to an address in flash before relocation.
13             * We need to update it to point to the same CPU entry in RAM.
14             * TODO: why not just add gd->reloc_ofs?
15             */
16            gd->arch.cpu += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
17    
18            /*
19             * If we didn't know the cpu mask & # cores, we can save them of
20             * now rather than 'computing' them constantly
21             */
22            fixup_cpu();
23    #endif
24    #ifdef CONFIG_SYS_EXTRA_ENV_RELOC
25            /*
26             * Some systems need to relocate the env_addr pointer early because the
27             * location it points to will get invalidated before env_relocate is
28             * called.  One example is on systems that might use a L2 or L3 cache
29             * in SRAM mode and initialize that cache from SRAM mode back to being
30             * a cache in cpu_init_r.
31             */
32            gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
33    #endif
34    #ifdef CONFIG_OF_EMBED
35            /*
36            * The fdt_blob needs to be moved to new relocation address
37            * incase of FDT blob is embedded with in image
38            */
39            gd->fdt_blob += gd->reloc_off;
40    #endif
41    #ifdef CONFIG_EFI_LOADER
42            efi_runtime_relocate(gd->relocaddr, NULL);
43    #endif
44    
45            return 0;
46    }

3번줄의 __ARM__에 의해 3 ~ 9번줄 중 4번줄만 수행됩니다. 10번줄은 거짓이 되어 23번줄까지 수행되지 않습니다. 24번줄의 CONFIG_SYS_EXTRA_ENV_RELOC은 선언되어 있지 않아 33번줄까지 수행되지 않습니다. 41번줄의 CONFIG_EFI_LOADER은 선언되어 있어 efi_runtime_relocate함수를 실행합니다.

.

results matching ""

    No results matching ""