Ignore:
Timestamp:
Jan 29, 2018, 6:08:07 PM (6 years ago)
Author:
alain
Message:

blip

File:
1 edited

Legend:

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

    r409 r428  
    205205        if (func == DEV_FUNC_TXT )
    206206        {
    207             assert( (channels > 0) , __FUNCTION__ ,
    208                     "numner of TXT channels cannot be 0\n");
    209 
    210             // initializes TXT0 basic fields
     207            assert( (channels > 0) , __FUNCTION__ , "number of TXT channels cannot be 0\n");
     208
     209            // initializes TXT_TX[0] chdev
    211210            txt0_chdev.func    = func;
    212211            txt0_chdev.impl    = impl;
     
    366365        uint32_t        directions;      // number of directions (1 or 2)
    367366        uint32_t        rx;              // direction index (0 or 1)
    368     uint32_t        first_channel;   // used in loop on channels for TXT
    369367    chdev_t       * chdev;           // local pointer on one channel_device descriptor
    370368    uint32_t        ext_chdev_gid;   // global index of external chdev
     
    388386        if((func == DEV_FUNC_NIC) || (func == DEV_FUNC_TXT)) directions = 2;
    389387        else                                                 directions = 1;
    390 
    391         // The TXT0 chdev has already been created
    392         if (func == DEV_FUNC_TXT) first_channel = 1;
    393         else                      first_channel = 0;
    394388
    395389        // do nothing for ROM, that does not require a device descriptor.
     
    412406
    413407        // loops on channels
    414         for( channel = first_channel ; channel < channels ; channel++ )
     408        for( channel = 0 ; channel < channels ; channel++ )
    415409        {
    416410            // loop on directions
    417411            for( rx = 0 ; rx < directions ; rx++ )
    418412            {
     413                // skip TXT_TX[0] chdev that has already been created & registered
     414                if( (func == DEV_FUNC_TXT) && (channel == 0) && (rx == 0) ) continue;
     415
    419416                // compute target cluster for chdev[func,channel,direction]
    420417                uint32_t offset     = ext_chdev_gid % ( info->x_size * info->y_size );
     
    587584            else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel];
    588585            else if( func == DEV_FUNC_IOB )                 ptr = &iopic_input.iob;
    589             else     panic( "illegal source device for IOPIC input" );
     586            else     assert( false , __FUNCTION__ , "illegal source device for IOPIC input" );
    590587
    591588            // set one entry in all "iopic_input" structures
     
    796793    if( error )
    797794    {
    798         panic("illegal core identifiers gid = %x / cxy = %x / lid = %d",
    799               core_lid , core_cxy , core_lid );
     795        assert( false , __FUNCTION__ ,
     796        "illegal core identifiers gid = %x / cxy = %x / lid = %d",
     797        core_lid , core_cxy , core_lid );
    800798    }
    801799
     
    807805        if( error )
    808806        {
    809             panic("cannot initialise cluster %x", local_cxy );
     807            assert( false , __FUNCTION__ ,
     808            "cannot initialise cluster %x", local_cxy );
    810809        }
    811810    }
     
    831830
    832831    // all CP0s initialize the process_zero descriptor
    833     if( core_lid == 0 ) process_zero_init( &process_zero );
     832    if( core_lid == 0 ) process_zero_create( &process_zero );
    834833
    835834    // CP0 in cluster 0 initializes the PIC chdev,
     
    900899    if( error )
    901900    {
    902         panic("core[%x][%d] cannot initialize idle thread",
    903               local_cxy , core_lid );
     901        assert( false , __FUNCTION__ ,
     902        "core[%x][%d] cannot initialize idle thread", local_cxy , core_lid );
    904903    }
    905904
     
    965964        else
    966965        {
    967             panic("root FS must be FATFS");
     966            assert( false , __FUNCTION__ ,
     967            "root FS must be FATFS" );
    968968        }
    969969
     
    11131113
    11141114    /////////////////////////////////////////////////////////////////////////////////
    1115     // STEP 8 : CP0 in I/O cluster creates the first user process (process_init)
    1116     /////////////////////////////////////////////////////////////////////////////////
    1117 
    1118     if( (core_lid ==  0) && (local_cxy == io_cxy) )
    1119     {
    1120         process_init_create();
     1115    // STEP 8 : CP0 in cluster 0 creates the first user process (process_init)
     1116    /////////////////////////////////////////////////////////////////////////////////
     1117
     1118    if( (core_lid ==  0) && (local_cxy == 0) )
     1119    {
     1120
     1121#if CONFIG_KINIT_DEBUG
     1122vfs_display( vfs_root_inode_xp );
     1123#endif
     1124
     1125       process_init_create();
    11211126    }
    11221127
     
    11271132    /////////////////////////////////////////////////////////////////////////////////
    11281133
    1129 #if CONFIG_KINIT_DEBUG
    1130 sched_display( core_lid );
    1131 #endif
    1132 
    11331134    if( (core_lid ==  0) && (local_cxy == 0) )
    11341135    kinit_dmsg("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n",
     
    11441145
    11451146#if CONFIG_KINIT_DEBUG
    1146 
    1147         vfs_display( vfs_root_inode_xp );
    11481147
    11491148        printk("\n\n***** memory fooprint for main kernel objects\n\n"
Note: See TracChangeset for help on using the changeset viewer.