Changeset 561 for trunk/kernel/kern/cluster.c
- Timestamp:
- Sep 21, 2018, 10:26:47 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/cluster.c
r557 r561 45 45 #include <process.h> 46 46 #include <dqdt.h> 47 #include <cluster_info.h> 47 48 48 49 ///////////////////////////////////////////////////////////////////////////////////// … … 212 213 } // end cluster_init() 213 214 215 ///////////////////////////////// 216 cxy_t cluster_random_select( void ) 217 { 218 uint32_t x_size; 219 uint32_t y_size; 220 uint32_t y_width; 221 uint32_t index; 222 uint32_t x; 223 uint32_t y; 224 225 do { 226 x_size = LOCAL_CLUSTER->x_size; 227 y_size = LOCAL_CLUSTER->y_size; 228 y_width = LOCAL_CLUSTER->y_width; 229 index = ( hal_get_cycles() + hal_get_gid() ) % (x_size * y_size); 230 x = index / y_size; 231 y = index % y_size; 232 } while ( cluster_info_is_active( LOCAL_CLUSTER->cluster_info[x][y] ) == 0 ); 233 234 return (x<<y_width) + y; 235 } 236 214 237 //////////////////////////////////////// 215 238 bool_t cluster_is_undefined( cxy_t cxy )
Note: See TracChangeset
for help on using the changeset viewer.