Changeset 561 for trunk/kernel/mm/vmm.c
- Timestamp:
- Sep 21, 2018, 10:26:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/vmm.c
r530 r561 45 45 #include <kmem.h> 46 46 #include <vmm.h> 47 #include <cluster_info.h> 47 48 48 49 ////////////////////////////////////////////////////////////////////////////////// … … 1384 1385 if( flags & VSEG_DISTRIB ) // distributed => cxy depends on vpn LSB 1385 1386 { 1386 uint32_t x_ max = LOCAL_CLUSTER->x_max; // [FIXME]1387 uint32_t y_ max = LOCAL_CLUSTER->y_max; // [FIXME]1387 uint32_t x_size = LOCAL_CLUSTER->x_size; 1388 uint32_t y_size = LOCAL_CLUSTER->y_size; 1388 1389 uint32_t y_width = LOCAL_CLUSTER->y_width; 1389 uint32_t index = vpn & ((x_max * y_max) - 1); // [FIXME] 1390 uint32_t x = index / y_max; // [FIXME] 1391 uint32_t y = index % y_max; // [FIXME] 1392 page_cxy = (x<<y_width) + y; 1390 uint32_t index = vpn & ((x_size * y_size) - 1); 1391 uint32_t x = index / y_size; 1392 uint32_t y = index % y_size; 1393 1394 // If the cluster selected from VPN's LSBs is empty, then we select one randomly 1395 // cluster_random_select() ensures that its randomly selected cluster is not empty 1396 if ( cluster_info_is_active( LOCAL_CLUSTER->cluster_info[x][y] ) == 0 ) { 1397 cxy_t cxy = cluster_random_select(); 1398 x = ( ( cxy >> y_width ) & 0xF); 1399 y = ( cxy & 0xF ); 1400 } 1401 page_cxy = ( x << y_width ) + y; 1393 1402 } 1394 1403 else // other cases => cxy specified in vseg 1395 1404 { 1396 page_cxy 1405 page_cxy = vseg->cxy; 1397 1406 } 1398 1407
Note: See TracChangeset
for help on using the changeset viewer.