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

heu...

Location:
soft/giet_vm/giet_common
Files:
2 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
  • soft/giet_vm/giet_common/utils.h

    r295 r324  
    1717#include <giet_config.h>
    1818
     19//////////////////////////////////////////////////////////////////////////////////
     20// NULL pointer definition
     21//////////////////////////////////////////////////////////////////////////////////
     22
     23#define NULL (void *)0
     24
    1925///////////////////////////////////////////////////////////////////////////////////
    2026// For retrieving base addresses defined in seg.ld file.
     
    2329typedef struct _ld_symbol_s _ld_symbol_t;
    2430
    25 // non replicated peripherals
    26 extern _ld_symbol_t seg_iob_base;
    27 extern _ld_symbol_t seg_nic_base;
    28 extern _ld_symbol_t seg_cma_base;
    29 extern _ld_symbol_t seg_tty_base;
    30 extern _ld_symbol_t seg_fbf_base;
    31 extern _ld_symbol_t seg_pic_base;
    32 extern _ld_symbol_t seg_ioc_base;
    33 extern _ld_symbol_t seg_sim_base;
    34 
    35 // replicated peripherals
    36 extern _ld_symbol_t seg_icu_base;
    37 extern _ld_symbol_t seg_xcu_base;
    38 extern _ld_symbol_t seg_tim_base;
    39 extern _ld_symbol_t seg_dma_base;
    40 extern _ld_symbol_t seg_mmc_base;
    41 
    42 // for replicated peripherals
    43 extern _ld_symbol_t vseg_cluster_increment;
    44 
    45 // boot and kernel segments base addresses & sizes
    46 extern _ld_symbol_t seg_boot_code_base;
    47 extern _ld_symbol_t seg_boot_code_size;
    48 
    49 extern _ld_symbol_t seg_boot_data_base;
    50 extern _ld_symbol_t seg_boot_data_size;
    51 
    52 extern _ld_symbol_t seg_boot_stack_base;
    53 extern _ld_symbol_t seg_boot_stack_size;
    54 
    55 extern _ld_symbol_t seg_boot_mapping_base;
    56 extern _ld_symbol_t seg_boot_mapping_size;
    57 
    58 extern _ld_symbol_t seg_boot_buffer_base;
    59 extern _ld_symbol_t seg_boot_buffer_size;
    60 
    61 extern _ld_symbol_t seg_kernel_code_base;
    62 extern _ld_symbol_t seg_kernel_code_size;
    63 
    64 extern _ld_symbol_t seg_kernel_data_base;
    65 extern _ld_symbol_t seg_kernel_data_size;
    66 
    67 extern _ld_symbol_t seg_kernel_uncdata_base;
    68 extern _ld_symbol_t seg_kernel_uncdata_size;
    69 
    70 extern _ld_symbol_t seg_kernel_init_base;
    71 extern _ld_symbol_t seg_kernel_init_size;
    72 
    73 extern _ld_symbol_t seg_ram_disk_base;
    74 extern _ld_symbol_t seg_ram_disk_size;
    75 
    76 extern _ld_symbol_t seg_reset_code_base;
    77 extern _ld_symbol_t seg_reset_code_size;
     31// boot segments vbase addresses & sizes
     32extern _ld_symbol_t boot_code_vbase;
     33extern _ld_symbol_t boot_code_size;
     34
     35extern _ld_symbol_t boot_data_vbase;
     36extern _ld_symbol_t boot_data_size;
     37
     38extern _ld_symbol_t boot_stack_vbase;
     39extern _ld_symbol_t boot_stack_size;
     40
     41extern _ld_symbol_t boot_mapping_vbase;
     42extern _ld_symbol_t boot_mapping_size;
     43
     44extern _ld_symbol_t boot_buffer_vbase;
     45extern _ld_symbol_t boot_buffer_size;
     46
     47// kernel segments vbase addresses & sizes
     48extern _ld_symbol_t kernel_code_vbase;
     49extern _ld_symbol_t kernel_code_size;
     50
     51extern _ld_symbol_t kernel_data_vbase;
     52extern _ld_symbol_t kernel_data_size;
     53
     54extern _ld_symbol_t kernel_uncdata_vbase;
     55extern _ld_symbol_t kernel_uncdata_size;
     56
     57extern _ld_symbol_t kernel_init_vbase;
     58extern _ld_symbol_t kernel_init_size;
    7859
    7960///////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.