Changeset 561 for trunk/kernel/mm


Ignore:
Timestamp:
Sep 21, 2018, 10:26:47 PM (6 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/mm/vmm.c

    r530 r561  
    4545#include <kmem.h>
    4646#include <vmm.h>
     47#include <cluster_info.h>
    4748
    4849//////////////////////////////////////////////////////////////////////////////////
     
    13841385    if( flags & VSEG_DISTRIB )    // distributed => cxy depends on vpn LSB
    13851386    {
    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;
    13881389        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;
    13931402    }
    13941403    else                          // other cases => cxy specified in vseg
    13951404    {
    1396         page_cxy         = vseg->cxy;
     1405        page_cxy = vseg->cxy;
    13971406    }
    13981407
Note: See TracChangeset for help on using the changeset viewer.