Ignore:
Timestamp:
Sep 21, 2018, 10:26:47 PM (3 years ago)
Author:
nicolas.van.phan@…
Message:

Remove y_max in all functions except dqdt_init()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/cluster.c

    r557 r561  
    4545#include <process.h>
    4646#include <dqdt.h>
     47#include <cluster_info.h>
    4748
    4849/////////////////////////////////////////////////////////////////////////////////////
     
    212213} // end cluster_init()
    213214
     215/////////////////////////////////
     216cxy_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
    214237////////////////////////////////////////
    215238bool_t cluster_is_undefined( cxy_t cxy )
Note: See TracChangeset for help on using the changeset viewer.