Ignore:
Timestamp:
Jun 25, 2014, 2:19:37 PM (10 years ago)
Author:
cfuguet
Message:

giet_vm optimizations:

  • Several modifications in GIET_VM in order to support compilation with GCC optimizations (-O2) activated.
  • Adding missing volatile in some global variables.
  • Using ioread and iowrite utility functions in peripheral drivers which prevent GCC to remove writes or reads in hardware memory mapped registers.
  • Code refactoring of stdio printf functions. Now, shr_printf and tty_printf function reuse the same function body. The only difference is that shr_printf wraps printf function call with TTY get lock and release lock.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/kernel_init.c

    r330 r345  
    116116
    117117__attribute__((section (".kdata")))
    118 unsigned int _ptabs_vaddr[GIET_NB_VSPACE_MAX];    // virtual addresses
     118volatile unsigned int _ptabs_vaddr[GIET_NB_VSPACE_MAX];    // virtual addresses
    119119
    120120__attribute__((section (".kdata")))       
    121 unsigned int _ptabs_ptprs[GIET_NB_VSPACE_MAX];    // physical addresses >> 13
     121volatile unsigned int _ptabs_ptprs[GIET_NB_VSPACE_MAX];    // physical addresses >> 13
    122122
    123123///////////////////////////////////////////////////////////////////////////////////
     
    126126
    127127__attribute__((section (".kdata")))
    128 static_scheduler_t* _schedulers[NB_PROCS_MAX<<(X_WIDTH+Y_WIDTH)]; // virtual addresses
     128volatile static_scheduler_t* _schedulers[NB_PROCS_MAX<<(X_WIDTH+Y_WIDTH)]; // virtual addresses
    129129
    130130////////////////////////////////////////////////////////////////////////////////////
     
    133133
    134134__attribute__((section (".kdata")))
    135 unsigned int _idle_stack[X_SIZE * Y_SIZE * NB_PROCS_MAX * 128 ];
     135volatile unsigned int _idle_stack[X_SIZE * Y_SIZE * NB_PROCS_MAX * 128 ];
    136136
    137137////////////////////////////////////////////////////////////////////////////////////
     
    140140
    141141__attribute__((section (".kdata")))
    142 unsigned int _init_barrier = 0;
     142volatile unsigned int _init_barrier = 0;
    143143
    144144///////////////////////////////////////////////////////////////////////////////////
     
    340340
    341341    // busy waiting until all processors synchronized
    342     while ( _init_barrier != NB_TOTAL_PROCS ) asm volatile ("nop");
     342    while ( _init_barrier != NB_TOTAL_PROCS );
    343343
    344344    // set registers and jump to user code
     
    351351                   :
    352352                   : "r"(sp_value), "r"(sr_value), "r"(ptpr_value), "r"(epc_value)
    353                    : "$29" );
     353                   : "$29", "memory" );
    354354
    355355} // end kernel_init()
Note: See TracChangeset for help on using the changeset viewer.