void iar_xdc_startup_exec(void)
{
    /*------------------------------------------------------------------------*/
    /* Process XDC Startup                                                    */
    /*------------------------------------------------------------------------*/
    if (&xdc_runtime_Startup__EXECFXN__C == (int*)1) {
        xdc_runtime_Startup_exec__E();
    }
}
Exemple #2
0
void _auto_init(void)
{
   /*------------------------------------------------------------------------*/
   /* Process the compressed cinit table. The format is:                     */
   /*                                                                        */
   /* |4-byte load addr|4-byte run addr|                                     */
   /* |4-byte load addr|4-byte run addr|                                     */
   /*                                                                        */
   /* Processing steps:                                                      */
   /*   1. Read load and run address.                                        */
   /*   2. Read one byte at load address, say idx.                           */
   /*   3. Get pointer to handler at handler_start[idx]                      */
   /*   4. call handler(load_addr + 1, run_addr)                             */
   /*------------------------------------------------------------------------*/
   unsigned char** table_ptr;
   unsigned char** table_limit;

   if (!(&__TI_Handler_Table_Base >= &__TI_Handler_Table_Limit))
   {
      table_ptr   = (unsigned char**) &__TI_CINIT_Base;
      table_limit = (unsigned char**) &__TI_CINIT_Limit;
      while (table_ptr < table_limit)
      {
        unsigned char* load_addr  = *table_ptr++;
        unsigned char* run_addr   = *table_ptr++;
        unsigned char handler_idx = *load_addr++;

        handler_fptr handler = HANDLER_TABLE[handler_idx];

        (*handler)((const unsigned char*)load_addr, run_addr);
      }
   }

   /*------------------------------------------------------------------------*/
   /* Process XDC Startup                                                    */
   /*------------------------------------------------------------------------*/
   if (&xdc_runtime_Startup__EXECFXN__C == (int*)1) {
      xdc_runtime_Startup_exec__E();
   }
   
   /*------------------------------------------------------------------------*/
   /* Process Pinit table for ELF.  The section is not NULL terminated.      */
   /* __TI_INITARRAY_Base and __TI_INITARRAY_Limit point to the beginning    */
   /* and end of the table.                                                  */
   /*------------------------------------------------------------------------*/
   if (__TI_INITARRAY_Base != __TI_INITARRAY_Limit)
   {
      int i = 0;
      while (&(__TI_INITARRAY_Base[i]) != __TI_INITARRAY_Limit)
         __TI_INITARRAY_Base[i++]();
   }
}
/*
 *  ======== startupC ========
 */
void startupC(void)
{
    int retVal;
    unsigned int * bs;
    unsigned int * be;
    unsigned int * dl;
    unsigned int * ds;
    unsigned int * de;
    size_t count;
    size_t i;

    /* initiailize .bss to zero */
    bs = & __bss_start__;
    be = & __bss_end__;
    while (bs < be) {
        *bs = 0;
        bs++;
    }

    /* relocate the .data section */
    dl = & __data_load__;
    ds = & __data_start__;
    de = & __data_end__;
    if (dl != ds) {
        while (ds < de) {
            *ds = *dl;
            dl++;
            ds++;
        }
    }

    /* run Startup_exec */
    xdc_runtime_Startup_exec__E();

    /* run any constructors */
    count = __init_array_end - __init_array_start;
    for (i = 0; i < count; i++) {
        __init_array_start[i]();
    }

    /* call main() */
    retVal = main();

    /* if get here call exit() */
    if (gnu_targets_arm_rtsv7M_exit != 0) {
        _exit(retVal);
    }
    else {
        xdc_runtime_System_exit__E(retVal);
    }

}
Exemple #4
0
void AUTO_INIT(void)
{
    run_binit();
    run_cinit();

   /*------------------------------------------------------------------------*/
   /* Process XDC Startup                                                    */
   /*------------------------------------------------------------------------*/
   if (&xdc_runtime_Startup__EXECFXN__C == (int*)1) {
      xdc_runtime_Startup_exec__E();
   }

    run_pinit();
}
Exemple #5
0
void AUTO_INIT_HOLD_WDT(void)
{
    run_binit();

    uint16_t initial_WDT = WDTCTL;

    run_cinit();

    WDTCTL = RESTORE_WDT(initial_WDT);

    /*------------------------------------------------------------------------*/
    /* Process XDC Startup                                                    */
    /*------------------------------------------------------------------------*/
    if (&xdc_runtime_Startup__EXECFXN__C == (int*)1) {
       xdc_runtime_Startup_exec__E();
    }

    run_pinit();
}
Exemple #6
0
/*
 *  ======== __xdc__init ========
 *  This function performs the initialization of all used modules
 */
extern "C" int  __xdc__init(void)
{
    xdc_runtime_Startup_exec__E();
    return 0;
}