- 论坛徽章:
- 0
|
u-boot中的启动序列指针数组.
init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */
board_init, /* basic board dependent setup */
interrupt_init, /* set up exceptions */
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
console_init_f, /* stage 1 init of console */
display_banner, /* say that we are here */
#if defined(CONFIG_DISPLAY_CPUINFO)
print_cpuinfo, /* display cpu info (and speed) */
#endif
#if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */
#endif
dram_init, /* configure available RAM banks */
display_dram_config,
NULL,
};
void start_armboot (void)
{
init_fnc_t **init_fnc_ptr;
char *s;
#ifndef CFG_NO_FLASH
ulong size;
#endif
#if defined(CONFIG_VFD) || defined(CONFIG_LCD)
#if !defined (CONFIG_AT91SAM9261EK) && !defined (CONFIG_AT91SAM9263EK)
unsigned long addr;
#endif
#endif
/* Pointer is writable since we allocated a register for it */
gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
memset ((void*)gd, 0, sizeof (gd_t));
gd->bd = (bd_t*)((char*)gd - sizeof(bd_t));
memset (gd->bd, 0, sizeof (bd_t));
monitor_flash_len = _bss_start - _armboot_start;
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {
hang ();
}
}
#ifndef CFG_NO_FLASH
/* configure available FLASH banks */
size = flash_init ();
display_flash_config (size);
_________________________________________________________________________
g-bios的启动步骤
extern INIT_FUNC_PTR g_pfInitCallBegin[], g_pfInitCallEnd[];
static __INIT__ int InitSysCrit(void)
{
int sn = 1;
INIT_FUNC_PTR *ppfInitCall = g_pfInitCallBegin;
while (ppfInitCall < g_pfInitCallEnd)
{
int ret;
printf("%2d. [0x%08x]: ", sn, *ppfInitCall);
ret = (*ppfInitCall)();
if (ret < 0)
puts("Failed!\n");
else
puts("OK!\n");
ppfInitCall++;
sn++;
}
return 0;
}
启动函数在哪里定义的? |
|