Changeset 559


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

Remove y_max in loops (easy replacements)

File:
1 edited

Legend:

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

    r556 r559  
    5959#include <devfs.h>
    6060#include <mapper.h>
     61#include <cluster_info.h>
    6162
    6263///////////////////////////////////////////////////////////////////////////////////////////
     
    255256            for( x = 0 ; x < info->x_size ; x++ )
    256257            {
    257                 for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     258                for( y = 0 ; y < info->y_size; y++ ) // [FIXME]
    258259                {
    259                     cxy_t  cxy = (x<<info->y_width) + y;
    260                     hal_remote_swd( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
    261                                     XPTR( local_cxy , &txt0_chdev ) );
     260                    if (cluster_info_is_active(info->cluster_info[x][y])) {
     261                        cxy_t  cxy = (x<<info->y_width) + y;
     262                        hal_remote_swd( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
     263                                        XPTR( local_cxy , &txt0_chdev ) );
     264                    }
    262265                }
    263266            }
     
    314317            for( x = 0 ; x < info->x_size ; x++ )
    315318            {
    316                 for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     319                for( y = 0 ; y < info->y_size; y++ ) // [FIXME]
    317320                {
    318                     cxy_t  cxy = (x<<info->y_width) + y;
    319                     hal_remote_swd( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
    320                                     XPTR( local_cxy , &txt0_chdev ) );
     321                    if (cluster_info_is_active(info->cluster_info[x][y])) {
     322                        cxy_t  cxy = (x<<info->y_width) + y;
     323                        hal_remote_swd( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
     324                                        XPTR( local_cxy , &txt0_chdev ) );
     325                    }
    321326                }
    322327            }
     
    380385            for( x = 0 ; x < info->x_size ; x++ )
    381386            {
    382                 for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     387                for( y = 0 ; y < info->y_size; y++ ) // [FIXME]
    383388                {
    384                     cxy_t  cxy = (x<<info->y_width) + y;
    385                     hal_remote_swd( XPTR( cxy , &chdev_dir.mmc[local_cxy] ),
    386                                     XPTR( local_cxy , chdev_ptr ) );
     389                    if (cluster_info_is_active(info->cluster_info[x][y])) {
     390                        cxy_t  cxy = (x<<info->y_width) + y;
     391                        hal_remote_swd( XPTR( cxy , &chdev_dir.mmc[local_cxy] ),
     392                                        XPTR( local_cxy , chdev_ptr ) );
     393                    }
    387394                }
    388395            }
     
    458465                        chdev_entry = &chdev_dir.txt_tx[channel];
    459466                    }
    460                     for ( x = 0; x < info->x_max; x++ )
     467                    for ( x = 0; x < info->x_size; x++ )
    461468                    {
    462                         for ( y = 0; y < info->y_max; y++ )
     469                        for ( y = 0; y < info->y_size; y++ )
    463470                        {
    464                             cxy_t cxy = (x<<info->y_width) + y;
    465                             hal_remote_swd( XPTR( cxy, chdev_entry ),
    466                                             XPTR( local_cxy, chdev_ptr ) );
     471                            if (cluster_info_is_active(info->cluster_info[x][y])) {
     472                                cxy_t cxy = (x<<info->y_width) + y;
     473                                hal_remote_swd( XPTR( cxy, chdev_entry ),
     474                                                XPTR( local_cxy, chdev_ptr ) );
     475                            }
    467476                        }
    468477                    }
     
    499508                // set the IOC fields in all clusters
    500509                xptr_t *chdev_entry = &chdev_dir.ioc[channel];
    501                 for ( x = 0; x < info->x_max; x++ )
     510                for ( x = 0; x < info->x_size; x++ )
    502511                {
    503                     for ( y = 0; y < info->y_max; y++ )
     512                    for ( y = 0; y < info->y_size; y++ )
    504513                    {
    505                         cxy_t cxy = (x<<info->y_width) + y;
    506                         hal_remote_swd( XPTR( cxy, chdev_entry ),
    507                                         XPTR( local_cxy, chdev_ptr ) );
     514                        if (cluster_info_is_active(info->cluster_info[x][y])) {
     515                            cxy_t cxy = (x<<info->y_width) + y;
     516                            hal_remote_swd( XPTR( cxy, chdev_entry ),
     517                                            XPTR( local_cxy, chdev_ptr ) );
     518                        }
    508519                    }
    509520    }
     
    650661                    for( x = 0 ; x < info->x_size ; x++ )
    651662                    {
    652                         for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     663                        for ( y = 0; y < info->y_size; y++ )
    653664                        {
    654                             cxy_t  cxy = (x<<info->y_width) + y;
    655                             hal_remote_swd( XPTR( cxy , entry ),
    656                                             XPTR( local_cxy , chdev ) );
     665                            if (cluster_info_is_active(info->cluster_info[x][y])) {
     666                                cxy_t  cxy = (x<<info->y_width) + y;
     667                                hal_remote_swd( XPTR( cxy , entry ),
     668                                                XPTR( local_cxy , chdev ) );
     669                            }
    657670                        }
    658671                    }
     
    733746    for( x = 0 ; x < info->x_size ; x++ )
    734747    {
    735         for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
    736         {
    737             cxy_t  cxy = (x<<info->y_width) + y;
    738             hal_remote_swd( XPTR( cxy , entry ) ,
    739                             XPTR( local_cxy , chdev ) );
     748        for ( y = 0; y < info->y_size; y++ )
     749        {
     750            if (cluster_info_is_active(info->cluster_info[x][y])) {
     751                cxy_t  cxy = (x<<info->y_width) + y;
     752                hal_remote_swd( XPTR( cxy , entry ) ,
     753                                XPTR( local_cxy , chdev ) );
     754            }
    740755        }
    741756    }
     
    747762    for( x = 0 ; x < info->x_size ; x++ )
    748763    {
    749         for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
    750         {
    751             cxy_t  cxy = (x<<info->y_width) + y;
    752             hal_remote_memset( XPTR( cxy , &iopic_input ) , 0xFF , sizeof(iopic_input_t) );
     764        for ( y = 0; y < info->y_size; y++ )
     765        {
     766            if (cluster_info_is_active(info->cluster_info[x][y])) {
     767                cxy_t  cxy = (x<<info->y_width) + y;
     768                hal_remote_memset( XPTR( cxy , &iopic_input ) , 0xFF , sizeof(iopic_input_t) );
     769            }
    753770        }
    754771    }
     
    784801            for( x = 0 ; x < info->x_size ; x++ )
    785802            {
    786                 for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     803                for ( y = 0; y < info->y_size; y++ )
    787804                {
    788                     cxy_t  cxy = (x<<info->y_width) + y;
    789                     hal_remote_swd( XPTR( cxy , ptr ) , id );
     805                    if (cluster_info_is_active(info->cluster_info[x][y])) {
     806                        cxy_t  cxy = (x<<info->y_width) + y;
     807                        hal_remote_swd( XPTR( cxy , ptr ) , id );
     808                    }
    790809                }
    791810            }
Note: See TracChangeset for help on using the changeset viewer.