Exemple #1
0
void __init3(void)
{
    /* Enable instruction cache. */
    ARM_SET_CP15_CR(ARM_GET_CP15_CR() | (1 << 12));

    /* Continue with runtime initialization. */
    __clear_bss();
}
void _premain()
{
	int t;
	unsigned long *pul;
	fptr f;

    UART_DATA = 0x31;
    UART_DATA = 0x2e;

//	__copy_data();
//	_initIO();
    __clear_bss();

    UART_DATA = 0x32;
    UART_DATA = 0x2e;

//    small_printf("\nCalling constructors...\n");

    pul = (unsigned long *)&__constructor_list;
    while(pul != (unsigned long *)&__end_of_constructors) {
//        small_printf("Constructor %p...\n", *pul);
        f = (fptr)*pul;
        f();
        pul++;
    }
        
    UART_DATA = 0x33;
    UART_DATA = 0x2e;

//    small_printf("\nStarting Main...\n");

	t=main(1, args);

    pul = (unsigned long *)&__end_of_destructors;
    do {
        pul--;
        if(pul < (unsigned long *)&__destructor_list)
        	break;
        small_printf("Destructor: %p...\n", *pul);
        f = (fptr)*pul;
        f();
    } while(1);

    small_printf("Done!\n");
//	exit(t);
//  for (;;);
}