Changeset 324
- Timestamp:
- Jun 10, 2014, 2:20:55 PM (10 years ago)
- Location:
- soft/giet_vm/giet_common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/utils.c
r315 r324 12 12 13 13 #include <giet_config.h> 14 #include <hard_config.h> 14 15 #include <mapping_info.h> 15 16 #include <utils.h> … … 890 891 891 892 /////////////////////////////////////////////////////////////////////////////////// 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. 893 894 // It uses the global task index (CTX_GTID_ID, unique for each giet task) and the 894 895 // vspace index (CTX_VSID_ID) defined in the task context. … … 897 898 unsigned int* size ) 898 899 { 899 mapping_header_t * header = (mapping_header_t *) (&seg_boot_mapping_base);900 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 900 901 mapping_task_t * tasks = _get_task_base(header); 901 902 mapping_vobj_t * vobjs = _get_vobj_base(header); 902 mapping_vspace_t * vspaces = _get_vspace_base(header);903 903 904 904 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; 914 911 } 915 912 else … … 917 914 *vaddr = 0; 918 915 *size = 0; 919 return 0;920 }916 } 917 return 0; 921 918 } 922 919 -
soft/giet_vm/giet_common/utils.h
r295 r324 17 17 #include <giet_config.h> 18 18 19 ////////////////////////////////////////////////////////////////////////////////// 20 // NULL pointer definition 21 ////////////////////////////////////////////////////////////////////////////////// 22 23 #define NULL (void *)0 24 19 25 /////////////////////////////////////////////////////////////////////////////////// 20 26 // For retrieving base addresses defined in seg.ld file. … … 23 29 typedef struct _ld_symbol_s _ld_symbol_t; 24 30 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 32 extern _ld_symbol_t boot_code_vbase; 33 extern _ld_symbol_t boot_code_size; 34 35 extern _ld_symbol_t boot_data_vbase; 36 extern _ld_symbol_t boot_data_size; 37 38 extern _ld_symbol_t boot_stack_vbase; 39 extern _ld_symbol_t boot_stack_size; 40 41 extern _ld_symbol_t boot_mapping_vbase; 42 extern _ld_symbol_t boot_mapping_size; 43 44 extern _ld_symbol_t boot_buffer_vbase; 45 extern _ld_symbol_t boot_buffer_size; 46 47 // kernel segments vbase addresses & sizes 48 extern _ld_symbol_t kernel_code_vbase; 49 extern _ld_symbol_t kernel_code_size; 50 51 extern _ld_symbol_t kernel_data_vbase; 52 extern _ld_symbol_t kernel_data_size; 53 54 extern _ld_symbol_t kernel_uncdata_vbase; 55 extern _ld_symbol_t kernel_uncdata_size; 56 57 extern _ld_symbol_t kernel_init_vbase; 58 extern _ld_symbol_t kernel_init_size; 78 59 79 60 ///////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.