Ignore:
Timestamp:
Jun 10, 2014, 1:28:14 PM (10 years ago)
Author:
alain
Message:

Various small modifs to comply with the genmap tool.

File:
1 edited

Legend:

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

    r310 r322  
    7171#include <mips32_registers.h>
    7272
     73#if !defined(X_SIZE)
     74# error: You must define X_SIZE in the hard_config.h file
     75#endif
     76
     77#if !defined(Y_SIZE)
     78# error: You must define Y_SIZE in the hard_config.h file
     79#endif
     80
     81#if !defined(Y_WIDTH)
     82# error: You must define Y_WIDTH in the hard_config.h file
     83#endif
     84
     85#if !defined(Y_WIDTH)
     86# error: You must define Y_WIDTH in the hard_config.h file
     87#endif
     88
     89#if !defined(NB_PROCS_MAX)
     90# error: You must define NB_PROCS_MAX in the hard_config.h file
     91#endif
     92
     93#if !defined(NB_TOTAL_PROCS)
     94# error: You must define NB_TOTAL_PROCS in the hard_config.h file
     95#endif
     96
     97#if !defined(USE_XCU)
     98# error: You must define USE_XCU in the hard_config.h file
     99#endif
     100
     101#if !defined(IDLE_TASK_INDEX)
     102# error: You must define IDLE_TASK_INDEX in the giet_config.h file
     103#endif
     104
     105#if !defined(GIET_TICK_VALUE)
     106# error: You must define GIET_TICK_VALUE in the giet_config.h file
     107#endif
     108
     109#if !defined(GIET_NB_VSPACE_MAX)
     110# error: You must define GIET_NB_VSPACE_MAX in the giet_config.h file
     111#endif
     112
    73113///////////////////////////////////////////////////////////////////////////////////
    74114// array of pointers on the page tables (virtual addresses)
     
    110150    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
    111151    unsigned int lpid       = global_pid % NB_PROCS_MAX;
    112     unsigned int nprocs     = TOTAL_PROCS;
    113152    unsigned int pid        = ((( x * Y_SIZE) + y) * NB_PROCS_MAX) + lpid;
    114153//  unsigned int pid        = _get_id(i n_procs );
     
    217256    unsigned int channel = lpid * IRQ_PER_PROCESSOR;
    218257
    219 #if USE_XICU
     258#if USE_XCU
    220259    _xcu_set_mask( cluster_xy, channel, hwi_mask, IRQ_TYPE_HWI );
    221260    _xcu_set_mask( cluster_xy, channel, wti_mask, IRQ_TYPE_WTI );
     
    238277        // start system timer
    239278
    240 #if USE_XICU
     279#if USE_XCU
    241280        _xcu_timer_start( cluster_xy, isr_switch_index, GIET_TICK_VALUE );
    242281#else
     
    296335            x, y, lpid, _get_proctime() );
    297336
    298 /*
    299     unsigned int*  pcount = &_init_barrier;
    300     unsigned int   count;
    301 
    302     // increment barrier counter with atomic LL/SC
    303     asm volatile ( "_init_barrier_loop:             \n"
    304                    "ll    %0,   0(%1)               \n"
    305                    "addi  $3,   %0,   1             \n"
    306                    "sc    $3,   0(%1)               \n"
    307                    "beqz  $3,   _init_barrier_loop  \n"
    308                    "nop                             \n"
    309                    : "=&r"(count)
    310                    : "r"(pcount)
    311                    : "$3" );
    312    
    313     // busy waiting until all processors synchronized
    314     while ( *pcount != nprocs ) asm volatile ("nop");
    315 */
    316 
    317337    // increment barrier counter
    318338    _init_barrier++;
    319339
    320340    // busy waiting until all processors synchronized
    321     while ( _init_barrier != nprocs ) asm volatile ("nop");
    322 
    323 /*
    324     _printf("\n[GIET] Processor[%d,%d,%d] jumps to user code at cycle %d\n",
    325             x, y, lpid, _get_proctime() );
    326 */
    327        
     341    while ( _init_barrier != NB_TOTAL_PROCS ) asm volatile ("nop");
     342
    328343    // set registers and jump to user code
    329344    asm volatile ( "move  $29,  %0                  \n"   /* SP <= ctx[CTX_SP_ID] */
Note: See TracChangeset for help on using the changeset viewer.