Changeset 601 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Dec 3, 2018, 12:15:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r583 r601 159 159 160 160 "CLUSTER_PREFTBL", // 21 161 161 162 "PPM_DIRTY", // 22 162 163 163 "CLUSTER_LOCALS", // 23 164 164 "CLUSTER_COPIES", // 24 … … 166 166 "PROCESS_USERSYNC", // 26 167 167 "PROCESS_FDARRAY", // 27 168 169 "MAPPER_STATE", // 28 168 "FATFS_FREE", // 28 169 170 170 "PROCESS_THTBL", // 29 171 171 172 "PROCESS_CWD", // 30 173 "VFS_INODE", // 31 174 "VFS_FILE", // 32 175 "VMM_VSL", // 33 176 "VMM_GPT", // 34 172 "MAPPER_STATE", // 30 173 "PROCESS_CWD", // 31 174 "VFS_INODE", // 32 175 "VFS_FILE", // 33 176 "VMM_VSL", // 34 177 "VMM_GPT", // 35 177 178 }; 178 179 179 // these debug variables are usedto analyse the sys_read() and sys_write() syscalls timing180 // debug variables to analyse the sys_read() and sys_write() syscalls timing 180 181 181 182 #if DEBUG_SYS_READ … … 417 418 #if( DEBUG_KERNEL_INIT & 0x1 ) 418 419 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 419 printk("\n[ DBG] %s: created MMC in cluster %x / chdev = %x\n",420 printk("\n[%s] : created MMC in cluster %x / chdev = %x\n", 420 421 __FUNCTION__ , local_cxy , chdev_ptr ); 421 422 #endif … … 451 452 #if( DEBUG_KERNEL_INIT & 0x1 ) 452 453 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 453 printk("\n[ DBG] %s: created DMA[%d] in cluster %x / chdev = %x\n",454 printk("\n[%s] : created DMA[%d] in cluster %x / chdev = %x\n", 454 455 __FUNCTION__ , channel , local_cxy , chdev_ptr ); 455 456 #endif … … 611 612 #if( DEBUG_KERNEL_INIT & 0x1 ) 612 613 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 613 printk("\n[ DBG] %s: create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",614 printk("\n[%s] : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n", 614 615 __FUNCTION__ , chdev_func_str( func ), channel , rx , local_cxy , chdev ); 615 616 #endif … … 779 780 780 781 #if( DEBUG_KERNEL_INIT & 0x1 ) 781 if( hal_tim _stamp() > DEBUG_KERNEL_INIT )782 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 782 783 { 783 printk("\n[ DBG] %screated PIC chdev in cluster %x at cycle %d\n",784 printk("\n[%s] created PIC chdev in cluster %x at cycle %d\n", 784 785 __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() ); 785 786 dev_pic_inputs_display(); … … 969 970 #if DEBUG_KERNEL_INIT 970 971 if( (core_lid == 0) & (local_cxy == 0) ) 971 printk("\n[ DBG] %s: exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n",972 printk("\n[%s] : exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n", 972 973 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 973 974 #endif … … 1011 1012 #if DEBUG_KERNEL_INIT 1012 1013 if( (core_lid == 0) & (local_cxy == 0) ) 1013 printk("\n[ DBG] %s: exit barrier 1 : clusters initialised / sr %x / cycle %d\n",1014 printk("\n[%s] : exit barrier 1 : clusters initialised / sr %x / cycle %d\n", 1014 1015 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1015 1016 #endif … … 1038 1039 #if DEBUG_KERNEL_INIT 1039 1040 if( (core_lid == 0) & (local_cxy == 0) ) 1040 printk("\n[ DBG] %s: exit barrier 2 : PIC initialised / sr %x / cycle %d\n",1041 printk("\n[%s] : exit barrier 2 : PIC initialised / sr %x / cycle %d\n", 1041 1042 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1042 1043 #endif … … 1071 1072 #if DEBUG_KERNEL_INIT 1072 1073 if( (core_lid == 0) & (local_cxy == 0) ) 1073 printk("\n[ DBG] %s : exit barrier 3 : all chdevinitialised / sr %x / cycle %d\n",1074 printk("\n[%s] : exit barrier 3 : all chdevs initialised / sr %x / cycle %d\n", 1074 1075 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1075 1076 #endif … … 1115 1116 if( CONFIG_VFS_ROOT_IS_FATFS ) 1116 1117 { 1117 // 1. allocate memory for FATFS context in cluster 01118 // 1. allocate memory for FATFS context extension in cluster 0 1118 1119 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 1119 1120 … … 1134 1135 uint32_t total_clusters = fatfs_ctx->fat_sectors_count << 7; 1135 1136 1136 // 4. initialize the FATFS entry in the vfs_context[] array 1137 vfs_ctx_init( FS_TYPE_FATFS, // fs type 1138 0, // attributes: unused 1139 total_clusters, 1140 cluster_size, 1141 vfs_root_inode_xp, // VFS root 1142 fatfs_ctx ); // extend 1143 1144 // 5. create VFS root inode in cluster 0 1137 // 4. create VFS root inode in cluster 0 1145 1138 error = vfs_inode_create( XPTR_NULL, // dentry_xp 1146 1139 FS_TYPE_FATFS, // fs_type 1147 1140 INODE_TYPE_DIR, // inode_type 1148 (void *)(intptr_t)root_dir_cluster, // extend1149 1141 0, // attr 1150 1142 0, // rights … … 1159 1151 } 1160 1152 1161 // 6. update the FATFS entry in vfs_context[] array1162 fs_context[FS_TYPE_FATFS].vfs_root_xp = vfs_root_inode_xp;1163 1164 // 7. check FATFS initialization1165 vfs_ctx_t * vfs_ctx = &fs_context[FS_TYPE_FATFS];1166 1167 if( ((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster != 8 )1168 {1169 printk("\n[PANIC] in %s : illegal FATFS context in cluster 0\n",1170 __FUNCTION__ ); 1171 hal_core_sleep(); 1172 } 1173 1153 // 5. update FATFS root inode extension 1154 cxy_t vfs_root_cxy = GET_CXY( vfs_root_inode_xp ); 1155 vfs_inode_t * vfs_root_ptr = GET_PTR( vfs_root_inode_xp ); 1156 hal_remote_spt( XPTR( vfs_root_cxy , &vfs_root_ptr->extend ), 1157 (void*)(intptr_t)root_dir_cluster ); 1158 1159 // 6. initialize the generic VFS context for FATFS 1160 vfs_ctx_init( FS_TYPE_FATFS, // fs type 1161 0, // attributes: unused 1162 total_clusters, // number of clusters 1163 cluster_size, // bytes 1164 vfs_root_inode_xp, // VFS root 1165 fatfs_ctx ); // extend 1174 1166 } 1175 1167 else … … 1193 1185 #if DEBUG_KERNEL_INIT 1194 1186 if( (core_lid == 0) & (local_cxy == 0) ) 1195 printk("\n[ DBG] %s: exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n",1187 printk("\n[%s] : exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n", 1196 1188 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1197 1189 #endif … … 1262 1254 #if DEBUG_KERNEL_INIT 1263 1255 if( (core_lid == 0) & (local_cxy == 1) ) 1264 printk("\n[ DBG] %s: exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n",1256 printk("\n[%s] : exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n", 1265 1257 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1266 1258 #endif … … 1311 1303 #if DEBUG_KERNEL_INIT 1312 1304 if( (core_lid == 0) & (local_cxy == 0) ) 1313 printk("\n[ DBG] %s: exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n",1305 printk("\n[%s] : exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n", 1314 1306 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1315 1307 #endif … … 1348 1340 #if DEBUG_KERNEL_INIT 1349 1341 if( (core_lid == 0) & (local_cxy == 0) ) 1350 printk("\n[ DBG] %s: exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n",1342 printk("\n[%s] : exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n", 1351 1343 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1352 1344 #endif … … 1374 1366 #if DEBUG_KERNEL_INIT 1375 1367 if( (core_lid == 0) & (local_cxy == 0) ) 1376 printk("\n[ DBG] %s: exit barrier 8 : process init created / sr %x / cycle %d\n",1368 printk("\n[%s] : exit barrier 8 : process init created / sr %x / cycle %d\n", 1377 1369 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1378 1370 #endif … … 1445 1437 1446 1438 #if DEBUG_KERNEL_INIT 1447 printk("\n[ DBG] %s: thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n",1439 printk("\n[%s] : thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n", 1448 1440 __FUNCTION__ , CURRENT_THREAD , local_cxy , core_lid , (uint32_t)hal_get_cycles() ); 1449 1441 #endif
Note: See TracChangeset
for help on using the changeset viewer.