Changeset 646


Ignore:
Timestamp:
Jul 22, 2015, 1:07:28 PM (9 years ago)
Author:
alain
Message:

Introduce support for the CTX_ENTRY_ID slot in task context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_boot/boot.c

    r631 r646  
    12251225        _set_mmu_ptpr( (unsigned int)(_ptabs_paddr[vspace_id][x][y] >> 13) );
    12261226
     1227        // ctx_norun depends on the vspace active field
     1228        unsigned int ctx_norun = (vspace[vspace_id].active == 0);
     1229
    12271230        // loop on the tasks in vspace (task_id is the global index in mapping)
    12281231        for (task_id = vspace[vspace_id].task_offset;
     
    12411244            unsigned int ctx_ptab = _ptabs_vaddr[vspace_id][req_x][req_y];
    12421245
    1243             // ctx_epc : Get the virtual address of the memory location containing
     1246            // ctx_entry : Get the virtual address of the memory location containing
    12441247            // the task entry point : the start_vector is stored by GCC in the
    12451248            // seg_data segment, and we must wait the .elf loading to get
    12461249            // the entry point value...
    12471250            vseg_id = vspace[vspace_id].start_vseg_id;     
    1248             unsigned int ctx_epc = vseg[vseg_id].vbase + (task[task_id].startid)*4;
     1251            unsigned int ctx_entry = vseg[vseg_id].vbase + (task[task_id].startid)*4;
    12491252
    12501253            // ctx_sp :  Get the vseg containing the stack
     
    12661269                    unsigned int ltid = psched->tasks;
    12671270
    1268                     // update the "tasks" and "current" fields in scheduler:
     1271                    // update the "tasks" field in scheduler:
    12691272                    psched->tasks   = ltid + 1;
    1270                     psched->current = 0;
    12711273
    12721274                    // initializes the task context
     
    12741276                    psched->context[ltid][CTX_SR_ID]     = GIET_SR_INIT_VALUE;
    12751277                    psched->context[ltid][CTX_SP_ID]     = ctx_sp;
    1276                     psched->context[ltid][CTX_EPC_ID]    = ctx_epc;
     1278                    psched->context[ltid][CTX_ENTRY_ID]  = ctx_entry;
    12771279                    psched->context[ltid][CTX_PTPR_ID]   = ctx_ptpr;
    12781280                    psched->context[ltid][CTX_PTAB_ID]   = ctx_ptab;
     
    12811283                    psched->context[ltid][CTX_TRDID_ID]  = thread_id;
    12821284                    psched->context[ltid][CTX_VSID_ID]   = vspace_id;
    1283                     psched->context[ltid][CTX_NORUN_ID]  = 0;
     1285                    psched->context[ltid][CTX_NORUN_ID]  = ctx_norun;
    12841286
    12851287                    psched->context[ltid][CTX_TTY_ID]    = 0xFFFFFFFF;
     
    13001302        " - ctx[SR]    = %x\n"
    13011303        " - ctx[SP]    = %x\n"
    1302         " - ctx[EPC]  = %x\n"
     1304        " - ctx[ENTRY] = %x\n"
    13031305        " - ctx[PTPR]  = %x\n"
    13041306        " - ctx[PTAB]  = %x\n"
    13051307        " - ctx[VSID]  = %d\n"
    1306         " - ctx[TRDID] = %d\n",
     1308        " - ctx[TRDID] = %d\n"
     1309        " - ctx[NORUN] = %x\n",
    13071310        task[task_id].name,
    13081311        vspace[vspace_id].name,
     
    13111314        psched->context[ltid][CTX_SR_ID],
    13121315        psched->context[ltid][CTX_SP_ID],
    1313         psched->context[ltid][CTX_EPC_ID],
     1316        psched->context[ltid][CTX_ENTRY_ID],
    13141317        psched->context[ltid][CTX_PTPR_ID],
    13151318        psched->context[ltid][CTX_PTAB_ID],
    13161319        psched->context[ltid][CTX_VSID_ID],
    1317         psched->context[ltid][CTX_TRDID_ID] );
     1320        psched->context[ltid][CTX_TRDID_ID],
     1321        psched->context[ltid][CTX_NORUN_ID] );
    13181322#endif
    13191323                } // end if FIT
     
    19361940    _set_sr( 0 );
    19371941
    1938     // Each proocessor get kernel entry virtual address
     1942    // Each processor get kernel entry virtual address
    19391943    unsigned int kernel_entry = (unsigned int)&kernel_init_vbase;
    19401944
Note: See TracChangeset for help on using the changeset viewer.