Ignore:
Timestamp:
Jun 10, 2014, 2:20:55 PM (10 years ago)
Author:
alain
Message:

heu...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_common/utils.c

    r315 r324  
    1212
    1313#include <giet_config.h>
     14#include <hard_config.h>
    1415#include <mapping_info.h>
    1516#include <utils.h>
     
    890891
    891892///////////////////////////////////////////////////////////////////////////////////
    892 // This function returns the information associated to a heap (size and vaddr)
     893// This function returns the information associated to a heap : size and vaddr.
    893894// It uses the global task index (CTX_GTID_ID, unique for each giet task) and the
    894895// vspace index (CTX_VSID_ID) defined in the task context.
     
    897898                         unsigned int* size )
    898899{
    899     mapping_header_t * header  = (mapping_header_t *) (&seg_boot_mapping_base);
     900    mapping_header_t * header  = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
    900901    mapping_task_t * tasks     = _get_task_base(header);
    901902    mapping_vobj_t * vobjs     = _get_vobj_base(header);
    902     mapping_vspace_t * vspaces = _get_vspace_base(header);
    903903
    904904    unsigned int taskid        = _get_context_slot(CTX_GTID_ID);
    905     unsigned int vspaceid      = _get_context_slot(CTX_VSID_ID);
    906 
    907     int heap_local_vobjid      = tasks[taskid].heap_vobjid;
    908     if (heap_local_vobjid != -1)
    909     {
    910         unsigned int vobjheapid = heap_local_vobjid + vspaces[vspaceid].vobj_offset;
    911         *vaddr                  = vobjs[vobjheapid].vaddr;
    912         *size                   = vobjs[vobjheapid].length;
    913         return 0;
     905
     906    int vobj_id = tasks[taskid].heap_vobj_id;
     907    if (vobj_id != -1)
     908    {
     909        *vaddr                  = vobjs[vobj_id].vaddr;
     910        *size                   = vobjs[vobj_id].length;
    914911    }
    915912    else
     
    917914        *vaddr = 0;
    918915        *size = 0;
    919         return 0;
    920     }
     916    }
     917    return 0;
    921918}
    922919
Note: See TracChangeset for help on using the changeset viewer.