Changeset 514 for soft/giet_vm
- Timestamp:
- Feb 14, 2015, 5:12:16 PM (10 years ago)
- Location:
- soft/giet_vm/giet_common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/kernel_malloc.c
r495 r514 145 145 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 146 146 mapping_vseg_t * vsegs = _get_vseg_base(header); 147 mapping_vobj_t * vobjs = _get_vobj_base(header);148 147 mapping_pseg_t * psegs = _get_pseg_base(header); 149 148 mapping_cluster_t * clusters = _get_cluster_base(header); 150 149 151 150 unsigned int vseg_id; 152 unsigned int vobj_id;153 151 unsigned int pseg_id; 154 152 unsigned int cluster_id; … … 167 165 pseg_id = vsegs[vseg_id].psegid; 168 166 cluster_id = psegs[pseg_id].clusterid; 169 vobj_id = vsegs[vseg_id].vobj_offset; 170 if ( (vobjs[vobj_id].type == VOBJ_TYPE_HEAP) && 167 if ( (vsegs[vseg_id].type == VSEG_TYPE_HEAP) && 171 168 (clusters[cluster_id].x == x) && 172 169 (clusters[cluster_id].y == y) ) 173 170 { 174 171 *heap_base = vsegs[vseg_id].vbase; 175 *heap_size = v objs[vobj_id].length;172 *heap_size = vsegs[vseg_id].length; 176 173 return 0; 177 174 } -
soft/giet_vm/giet_common/utils.c
r498 r514 620 620 } 621 621 ////////////////////////////////////////////////////////// 622 mapping_vobj_t * _get_vobj_base(mapping_header_t * header)623 {624 return (mapping_vobj_t *) ((char *) header +625 MAPPING_HEADER_SIZE +626 MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +627 MAPPING_PSEG_SIZE * header->psegs +628 MAPPING_VSPACE_SIZE * header->vspaces +629 MAPPING_VSEG_SIZE * header->vsegs );630 }631 //////////////////////////////////////////////////////////632 622 mapping_task_t * _get_task_base(mapping_header_t * header) 633 623 { … … 637 627 MAPPING_PSEG_SIZE * header->psegs + 638 628 MAPPING_VSPACE_SIZE * header->vspaces + 639 MAPPING_VOBJ_SIZE * header->vobjs +640 629 MAPPING_VSEG_SIZE * header->vsegs); 641 630 } … … 649 638 MAPPING_VSPACE_SIZE * header->vspaces + 650 639 MAPPING_VSEG_SIZE * header->vsegs + 651 MAPPING_VOBJ_SIZE * header->vobjs +652 640 MAPPING_TASK_SIZE * header->tasks); 653 641 } … … 661 649 MAPPING_VSPACE_SIZE * header->vspaces + 662 650 MAPPING_VSEG_SIZE * header->vsegs + 663 MAPPING_VOBJ_SIZE * header->vobjs +664 651 MAPPING_TASK_SIZE * header->tasks + 665 652 MAPPING_PROC_SIZE * header->procs); … … 673 660 MAPPING_PSEG_SIZE * header->psegs + 674 661 MAPPING_VSPACE_SIZE * header->vspaces + 675 MAPPING_VOBJ_SIZE * header->vobjs +676 662 MAPPING_VSEG_SIZE * header->vsegs + 677 663 MAPPING_TASK_SIZE * header->tasks + … … 687 673 MAPPING_PSEG_SIZE * header->psegs + 688 674 MAPPING_VSPACE_SIZE * header->vspaces + 689 MAPPING_VOBJ_SIZE * header->vobjs +690 675 MAPPING_VSEG_SIZE * header->vsegs + 691 676 MAPPING_TASK_SIZE * header->tasks + … … 702 687 MAPPING_PSEG_SIZE * header->psegs + 703 688 MAPPING_VSPACE_SIZE * header->vspaces + 704 MAPPING_VOBJ_SIZE * header->vobjs +705 689 MAPPING_VSEG_SIZE * header->vsegs + 706 690 MAPPING_TASK_SIZE * header->tasks + -
soft/giet_vm/giet_common/utils.h
r495 r514 163 163 extern mapping_vspace_t * _get_vspace_base(mapping_header_t* header); 164 164 extern mapping_vseg_t * _get_vseg_base(mapping_header_t* header); 165 extern mapping_vobj_t * _get_vobj_base(mapping_header_t* header);166 165 extern mapping_task_t * _get_task_base(mapping_header_t* header); 167 166 extern mapping_proc_t * _get_proc_base(mapping_header_t* header);
Note: See TracChangeset
for help on using the changeset viewer.