.

common/init/board\_init.c

1    ulong board_init_f_alloc_reserve(ulong top)
2    {
3        /* Reserve early malloc arena */
4    #if defined(CONFIG_SYS_MALLOC_F)
5            top -= CONFIG_SYS_MALLOC_F_LEN;
6    #endif
7            /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */
8            top = rounddown(top-sizeof(struct global_data), 16);
9
10            return top;
11    }
  • 4번 줄의 CONFIG_SYS_MALLOC_F이 정의 되어 있습니다.
  • 5번 줄의 CONFIG_SYS_MALLOC_F_LEN은 0x2000으로 정의 되어 있어 top -= 0x2000;이 수행됩니다. top의 값은 이 함수로 점프해 올때 r0 = 0x07FFFF30값입니다. 즉 top의 값은 0x07FFDF30이 됩니다.
  • 8번 줄은 macro로 define된 함수로 top = ( { typeof(top-sizeof(struct global_data)) __x = (top-sizeof(struct global_data)); __x - (__x % (16)); } );이 수행됩니다. 위 줄에서 계산된 top값(0x07FFDE60)이 리턴됩니다.

.

.

.

results matching ""

    No results matching ""