Changeset 516 for soft/giet_vm/giet_kernel/sys_handler.c
- Timestamp:
- Feb 14, 2015, 5:17:00 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r505 r516 146 146 &_sys_ukn, /* 0x18 */ 147 147 &_context_switch, /* 0x19 */ 148 &_sys_v obj_get_vbase, /* 0x1A */149 &_sys_v obj_get_length, /* 0x1B */148 &_sys_vseg_get_vbase, /* 0x1A */ 149 &_sys_vseg_get_length, /* 0x1B */ 150 150 &_sys_xy_from_ptr, /* 0x1C */ 151 151 &_sys_ukn, /* 0x1D */ … … 1354 1354 1355 1355 /////////////////////////////////////////////////////// 1356 int _sys_v obj_get_vbase( char* vspace_name,1357 char* v obj_name,1356 int _sys_vseg_get_vbase( char* vspace_name, 1357 char* vseg_name, 1358 1358 unsigned int* vbase ) 1359 1359 { 1360 1360 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 1361 1361 mapping_vspace_t * vspace = _get_vspace_base(header); 1362 mapping_v obj_t * vobj = _get_vobj_base(header);1362 mapping_vseg_t * vseg = _get_vseg_base(header); 1363 1363 1364 1364 unsigned int vspace_id; 1365 unsigned int v obj_id;1365 unsigned int vseg_id; 1366 1366 1367 1367 // scan vspaces … … 1370 1370 if (_strncmp( vspace[vspace_id].name, vspace_name, 31) == 0) 1371 1371 { 1372 // scan v objs1373 for (v obj_id = vspace[vspace_id].vobj_offset;1374 v obj_id < (vspace[vspace_id].vobj_offset + vspace[vspace_id].vobjs);1375 v obj_id++)1372 // scan vsegs 1373 for (vseg_id = vspace[vspace_id].vseg_offset; 1374 vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs); 1375 vseg_id++) 1376 1376 { 1377 if (_strncmp(v obj[vobj_id].name, vobj_name, 31) == 0)1377 if (_strncmp(vseg[vseg_id].name, vseg_name, 31) == 0) 1378 1378 { 1379 *vbase = v obj[vobj_id].vbase;1379 *vbase = vseg[vseg_id].vbase; 1380 1380 return 0; 1381 1381 } … … 1387 1387 1388 1388 ///////////////////////////////////////////////////////// 1389 int _sys_v obj_get_length( char* vspace_name,1390 char* v obj_name,1389 int _sys_vseg_get_length( char* vspace_name, 1390 char* vseg_name, 1391 1391 unsigned int* length ) 1392 1392 { 1393 1393 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 1394 1394 mapping_vspace_t * vspace = _get_vspace_base(header); 1395 mapping_v obj_t * vobj = _get_vobj_base(header);1395 mapping_vseg_t * vseg = _get_vseg_base(header); 1396 1396 1397 1397 unsigned int vspace_id; 1398 unsigned int v obj_id;1398 unsigned int vseg_id; 1399 1399 1400 1400 // scan vspaces … … 1403 1403 if (_strncmp( vspace[vspace_id].name, vspace_name, 31) == 0) 1404 1404 { 1405 // scan v objs1406 for (v obj_id = vspace[vspace_id].vobj_offset;1407 v obj_id < (vspace[vspace_id].vobj_offset + vspace[vspace_id].vobjs);1408 v obj_id++)1405 // scan vsegs 1406 for (vseg_id = vspace[vspace_id].vseg_offset; 1407 vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs); 1408 vseg_id++) 1409 1409 { 1410 if (_strncmp(v obj[vobj_id].name, vobj_name, 31) == 0)1410 if (_strncmp(vseg[vseg_id].name, vseg_name, 31) == 0) 1411 1411 { 1412 *length = v obj[vobj_id].length;1412 *length = vseg[vseg_id].length; 1413 1413 return 0; 1414 1414 } … … 1446 1446 { 1447 1447 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 1448 mapping_task_t * task s= _get_task_base(header);1449 mapping_v obj_t * vobjs = _get_vobj_base(header);1450 mapping_vspace_t * vspace s= _get_vspace_base(header);1448 mapping_task_t * task = _get_task_base(header); 1449 mapping_vseg_t * vseg = _get_vseg_base(header); 1450 mapping_vspace_t * vspace = _get_vspace_base(header); 1451 1451 1452 1452 unsigned int task_id; 1453 1453 unsigned int vspace_id; 1454 unsigned int v obj_id = 0xFFFFFFFF;1455 1456 // searching the heap v obj_id1454 unsigned int vseg_id = 0xFFFFFFFF; 1455 1456 // searching the heap vseg 1457 1457 if ( (x < X_SIZE) && (y < Y_SIZE) ) // searching a task in cluster(x,y) 1458 1458 { … … 1461 1461 1462 1462 // scan all tasks in vspace 1463 unsigned int min = vspace s[vspace_id].task_offset ;1464 unsigned int max = min + vspace s[vspace_id].tasks ;1463 unsigned int min = vspace[vspace_id].task_offset ; 1464 unsigned int max = min + vspace[vspace_id].tasks ; 1465 1465 for ( task_id = min ; task_id < max ; task_id++ ) 1466 1466 { 1467 if ( task s[task_id].clusterid == (x * Y_SIZE + y) )1467 if ( task[task_id].clusterid == (x * Y_SIZE + y) ) 1468 1468 { 1469 v obj_id = tasks[task_id].heap_vobj_id;1470 if ( v obj_id != 0xFFFFFFFF ) break;1469 vseg_id = task[task_id].heap_vseg_id; 1470 if ( vseg_id != 0xFFFFFFFF ) break; 1471 1471 } 1472 1472 } … … 1475 1475 { 1476 1476 task_id = _get_context_slot(CTX_GTID_ID); 1477 v obj_id = tasks[task_id].heap_vobj_id;1478 } 1479 1480 // analysing the v obj_id1481 if ( v obj_id != 0xFFFFFFFF )1482 { 1483 *vaddr = v objs[vobj_id].vbase;1484 *length = v objs[vobj_id].length;1477 vseg_id = task[task_id].heap_vseg_id; 1478 } 1479 1480 // analysing the vseg_id 1481 if ( vseg_id != 0xFFFFFFFF ) 1482 { 1483 *vaddr = vseg[vseg_id].vbase; 1484 *length = vseg[vseg_id].length; 1485 1485 return 0; 1486 1486 }
Note: See TracChangeset
for help on using the changeset viewer.