Ignore:
Timestamp:
Jul 4, 2012, 2:51:18 PM (12 years ago)
Author:
alain
Message:

Introducing various modifications in kernel initialisation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/ctx_handler.c

    r164 r165  
    2525// ctx[3] <- $3   ctx[11]<- $11   ctx[19]<- $19   ctx[27]<- HI    ctx[35]<- PTPR
    2626// ctx[4] <- $4   ctx[12]<- $12   ctx[20]<- $20   ctx[28]<- $28   ctx[36]<- MODE
    27 // ctx[5] <- $5   ctx[13]<- $13   ctx[21]<- $21   ctx[29]<- $29   ctx[37]<- reserved
     27// ctx[5] <- $5   ctx[13]<- $13   ctx[21]<- $21   ctx[29]<- $29   ctx[37]<- FBDMA
    2828// ctx[6] <- $6   ctx[14]<- $14   ctx[22]<- $22   ctx[30]<- $30   ctx[38]<- reserved
    2929// ctx[7] <- $7   ctx[15]<- $15   ctx[23]<- $23   ctx[31]<- $31   ctx[39]<- reserved
     
    6464    unsigned int *next_context;
    6565
    66     unsigned int tasks;
    67     unsigned int proc_id;
    68 
    69     proc_id = _procid();
    70     tasks   = _scheduler[proc_id].tasks;
     66    unsigned int pid   = _procid();
     67    unsigned int time  = _proctime();
     68    unsigned int tasks = _scheduler[pid].tasks;
    7169
    7270    // return if only one task  */
     
    7472 
    7573    // compute the task context base address for the current task
    76     curr_task_id = _scheduler[proc_id].current;
    77     curr_context = &(_scheduler[proc_id].context[curr_task_id][0]);
     74    curr_task_id = _scheduler[pid].current;
     75    curr_context = &(_scheduler[pid].context[curr_task_id][0]);
    7876   
    7977    // select the next task using a round-robin scheduling policy
     
    8179   
    8280    // compute the task context base address for the next task
    83     next_context = &(_scheduler[proc_id].context[next_task_id][0]);
    84 
    85     //  update the scheduler state, and makes the task switch
    86     _scheduler[proc_id].current = next_task_id;
    87     _task_switch( curr_context, next_context );
     81    next_context = &(_scheduler[pid].context[next_task_id][0]);
    8882
    8983#if GIET_DEBUG_SWITCH
    90 unsigned int time = _proctime();
     84_get_lock( &_tty_put_lock );
    9185_puts( "\n[GIET] Context switch for processor ");
    92 _putw( proc_id );
     86_putw( pid );
    9387_puts( " at cycle ");
    9488_putw( time );
     
    10397_putw( next_task_id );
    10498_puts("\n");
     99_release_lock( &_tty_put_lock );
    105100#endif
     101
     102    //  update the scheduler state, and makes the task switch
     103    _scheduler[pid].current = next_task_id;
     104    _task_switch( curr_context, next_context );
    106105
    107106} // end _ctx_switch
Note: See TracChangeset for help on using the changeset viewer.