Changeset 428 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Jan 29, 2018, 6:08:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r409 r428 205 205 if (func == DEV_FUNC_TXT ) 206 206 { 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 211 210 txt0_chdev.func = func; 212 211 txt0_chdev.impl = impl; … … 366 365 uint32_t directions; // number of directions (1 or 2) 367 366 uint32_t rx; // direction index (0 or 1) 368 uint32_t first_channel; // used in loop on channels for TXT369 367 chdev_t * chdev; // local pointer on one channel_device descriptor 370 368 uint32_t ext_chdev_gid; // global index of external chdev … … 388 386 if((func == DEV_FUNC_NIC) || (func == DEV_FUNC_TXT)) directions = 2; 389 387 else directions = 1; 390 391 // The TXT0 chdev has already been created392 if (func == DEV_FUNC_TXT) first_channel = 1;393 else first_channel = 0;394 388 395 389 // do nothing for ROM, that does not require a device descriptor. … … 412 406 413 407 // loops on channels 414 for( channel = first_channel; channel < channels ; channel++ )408 for( channel = 0 ; channel < channels ; channel++ ) 415 409 { 416 410 // loop on directions 417 411 for( rx = 0 ; rx < directions ; rx++ ) 418 412 { 413 // skip TXT_TX[0] chdev that has already been created & registered 414 if( (func == DEV_FUNC_TXT) && (channel == 0) && (rx == 0) ) continue; 415 419 416 // compute target cluster for chdev[func,channel,direction] 420 417 uint32_t offset = ext_chdev_gid % ( info->x_size * info->y_size ); … … 587 584 else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel]; 588 585 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" ); 590 587 591 588 // set one entry in all "iopic_input" structures … … 796 793 if( error ) 797 794 { 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 ); 800 798 } 801 799 … … 807 805 if( error ) 808 806 { 809 panic("cannot initialise cluster %x", local_cxy ); 807 assert( false , __FUNCTION__ , 808 "cannot initialise cluster %x", local_cxy ); 810 809 } 811 810 } … … 831 830 832 831 // 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 ); 834 833 835 834 // CP0 in cluster 0 initializes the PIC chdev, … … 900 899 if( error ) 901 900 { 902 panic("core[%x][%d] cannot initialize idle thread",903 901 assert( false , __FUNCTION__ , 902 "core[%x][%d] cannot initialize idle thread", local_cxy , core_lid ); 904 903 } 905 904 … … 965 964 else 966 965 { 967 panic("root FS must be FATFS"); 966 assert( false , __FUNCTION__ , 967 "root FS must be FATFS" ); 968 968 } 969 969 … … 1113 1113 1114 1114 ///////////////////////////////////////////////////////////////////////////////// 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 1122 vfs_display( vfs_root_inode_xp ); 1123 #endif 1124 1125 process_init_create(); 1121 1126 } 1122 1127 … … 1127 1132 ///////////////////////////////////////////////////////////////////////////////// 1128 1133 1129 #if CONFIG_KINIT_DEBUG1130 sched_display( core_lid );1131 #endif1132 1133 1134 if( (core_lid == 0) && (local_cxy == 0) ) 1134 1135 kinit_dmsg("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n", … … 1144 1145 1145 1146 #if CONFIG_KINIT_DEBUG 1146 1147 vfs_display( vfs_root_inode_xp );1148 1147 1149 1148 printk("\n\n***** memory fooprint for main kernel objects\n\n"
Note: See TracChangeset
for help on using the changeset viewer.