Ignore:
Timestamp:
Aug 16, 2017, 2:54:04 PM (7 years ago)
Author:
alain
Message:

Update the RPC_VMM_GET_VSEG.

File:
1 edited

Legend:

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

    r381 r389  
    273273            }
    274274
    275             kinit_dmsg("\n[INFO] %s : created MMC in cluster %x / chdev = %x\n",
    276                        __FUNCTION__ , channel , local_cxy , chdev_ptr );
     275#if( CONFIG_KINIT_DEBUG > 1 )
     276printk("\n[INFO] %s : created MMC in cluster %x / chdev = %x\n",
     277__FUNCTION__ , channel , local_cxy , chdev_ptr );
     278#endif
    277279        }
    278280        ///////////////////////////////
     
    299301                chdev_dir.dma[channel] = XPTR( local_cxy , chdev_ptr );
    300302
    301                 kinit_dmsg("\n[INFO] %s : created DMA[%d] in cluster %x / chdev = %x\n",
    302                            __FUNCTION__ , channel , local_cxy , chdev_ptr );
     303#if( CONFIG_KINIT_DEBUG > 1 )
     304printk("\n[INFO] %s : created DMA[%d] in cluster %x / chdev = %x\n",
     305__FUNCTION__ , channel , local_cxy , chdev_ptr );
     306#endif
    303307            }
    304308        }
     
    431435                    }
    432436
    433                             kinit_dmsg("\n[INFO] %s : create chdev %s[%d] in cluster %x / chdev = %x\n",
    434                     __FUNCTION__ , chdev_func_str( func ), channel , local_cxy , chdev );
    435 
     437#if( CONFIG_KINIT_DEBUG > 1 )
     438printk("\n[INFO] %s : create chdev %s[%d] in cluster %x / chdev = %x\n",
     439__FUNCTION__ , chdev_func_str( func ), channel , local_cxy , chdev );
     440#endif
    436441                }  // end if match
    437442
     
    548553    }
    549554
    550     kinit_dmsg("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n",
    551                __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
     555#if( CONFIG_KINIT_DEBUG > 1 )
     556printk("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n",
     557__FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
     558#endif
    552559   
    553560}  // end iopic_init()
     
    826833    /////////////////////////////////////////////////////////////////////////////////
    827834
    828     if( CONFIG_KINIT_DEBUG ) chdev_dir_display();
     835#if( CONFIG_KINIT_DEBUG > 1 )
     836chdev_dir_display();
     837#endif
    829838   
    830839    // All cores enable the shared IPI channel
     
    834843    // All cores initialize specific core registers
    835844    hal_core_init( info );
    836 
    837     kinit_dmsg("\n[INFO] %s : IRQs enabled for core[%x,%d] / SR = %x\n",
    838                __FUNCTION__ , local_cxy , core_lid , hal_get_sr() );
    839845
    840846    // all cores initialize the idle thread descriptor
     
    855861    core->scheduler.idle = thread;
    856862
    857     if( (core_lid ==  0) && (local_cxy == 0) )
    858     {
    859         kinit_dmsg("\n[INFO] %s : initialized idle thread %x on core[%x,%d] / cycle %d\n",
    860         __FUNCTION__ , thread->trdid , local_cxy, core_lid, (uint32_t)hal_time_stamp());
    861     }
    862 
    863     #if CONFIG_KINIT_DEBUG
    864     sched_display();
    865     #endif
     863#if( CONFIG_KINIT_DEBUG > 1 )
     864sched_display();
     865#endif
    866866
    867867    // CPO in cluster 0 creates the VFS root
     
    874874        if( CONFIG_VFS_ROOT_IS_FATFS )
    875875        {
    876             // 1. create FATFS context in cluster 0
     876            // 1. allocate memory for FATFS context in cluster 0
    877877            fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc();
    878878
     
    910910                              vfs_root_inode_xp,             // VFS root
    911911                          fatfs_ctx );                   // extend
     912
     913            // 6. check initialisation
     914            vfs_ctx_t   * vfs_ctx = &fs_context[FS_TYPE_FATFS];
     915            assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8),
     916            __FUNCTION__ , "illegal value for FATFS context in cluster %x\n", local_cxy );
    912917        }
    913918        else
    914919        {
    915             printk("\n[PANIC] in %s : root FS must be FATFS\n", __FUNCTION__ );
    916             hal_core_sleep();
    917         }
    918 
    919         // register VFS root inode in process_zero
     920            _panic("\n[PANIC] in %s : root FS must be FATFS\n", __FUNCTION__ );
     921        }
     922
     923        // register VFS root inode in process_zero descriptor of cluster 0
    920924        process_zero.vfs_root_xp = vfs_root_inode_xp;
    921925        process_zero.vfs_cwd_xp  = vfs_root_inode_xp;
     
    945949        if( CONFIG_VFS_ROOT_IS_FATFS )
    946950        {
    947             // allocate memory for FATFS context
    948             fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc();
    949 
    950             assert( (fatfs_ctx != NULL) , __FUNCTION__ , "cannot create FATFS context\n" );
    951 
    952             // get local pointer on VFS context for FATFS
     951            // 1. allocate memory for local FATFS context
     952            fatfs_ctx_t * local_fatfs_ctx = fatfs_ctx_alloc();
     953
     954            assert( (local_fatfs_ctx != NULL) , __FUNCTION__ ,
     955            "cannot create FATFS context in cluster %x\n", local_cxy );
     956
     957            // 2. get local pointer on VFS context for FATFS
    953958            vfs_ctx_t   * vfs_ctx = &fs_context[FS_TYPE_FATFS];
    954959
    955             // copy VFS context from cluster 0 to local cluster
     960            // 3. get local pointer on FATFS context in cluster 0
     961            fatfs_ctx_t * remote_fatfs_ctx = hal_remote_lpt( XPTR( 0 , &vfs_ctx->extend ) );
     962
     963            // 4. copy FATFS context from cluster 0 to local cluster
     964            hal_remote_memcpy( XPTR( local_cxy , local_fatfs_ctx ),
     965                               XPTR( 0 ,         remote_fatfs_ctx ), sizeof(fatfs_ctx_t) );
     966
     967            // 5. copy VFS context from cluster 0 to local cluster
    956968            hal_remote_memcpy( XPTR( local_cxy , vfs_ctx ),
    957                                XPTR( 0 , vfs_ctx ),
    958                                sizeof(vfs_ctx_t) );
    959 
    960             // copy FATFS context from cluster 0 to local cluster
    961             hal_remote_memcpy( XPTR( local_cxy , fatfs_ctx ),
    962                                XPTR( 0 , fatfs_ctx ),
    963                                sizeof(fatfs_ctx_t) );
    964 
    965             // update extend field in local copy of VFS context
    966             vfs_ctx->extend = fatfs_ctx;
     969                               XPTR( 0 ,         vfs_ctx ), sizeof(vfs_ctx_t) );
     970
     971            // 6. update extend field in local copy of VFS context
     972            vfs_ctx->extend = local_fatfs_ctx;
     973
     974            // 7. check initialisation
     975            assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8),
     976            __FUNCTION__ , "illegal value for FATFS context in cluster %x\n", local_cxy );
    967977        }
    968978
     
    10621072    {
    10631073        process_init_create();
     1074        vfs_display( vfs_root_inode_xp );
    10641075    }
    10651076
     
    10821093        print_banner( (info->x_size * info->y_size) , info->cores_nr );
    10831094
    1084         kinit_dmsg("\n\n*** memory fooprint for main kernet objects ***\n\n"
     1095        kinit_dmsg("\n\n***** memory fooprint for main kernet objects\n\n"
    10851096                   " - thread descriptor  : %d bytes\n"
    10861097                   " - process descriptor : %d bytes\n"
Note: See TracChangeset for help on using the changeset viewer.