Changeset 389 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Aug 16, 2017, 2:54:04 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r381 r389 273 273 } 274 274 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 ) 276 printk("\n[INFO] %s : created MMC in cluster %x / chdev = %x\n", 277 __FUNCTION__ , channel , local_cxy , chdev_ptr ); 278 #endif 277 279 } 278 280 /////////////////////////////// … … 299 301 chdev_dir.dma[channel] = XPTR( local_cxy , chdev_ptr ); 300 302 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 ) 304 printk("\n[INFO] %s : created DMA[%d] in cluster %x / chdev = %x\n", 305 __FUNCTION__ , channel , local_cxy , chdev_ptr ); 306 #endif 303 307 } 304 308 } … … 431 435 } 432 436 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 ) 438 printk("\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 436 441 } // end if match 437 442 … … 548 553 } 549 554 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 ) 556 printk("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n", 557 __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() ); 558 #endif 552 559 553 560 } // end iopic_init() … … 826 833 ///////////////////////////////////////////////////////////////////////////////// 827 834 828 if( CONFIG_KINIT_DEBUG ) chdev_dir_display(); 835 #if( CONFIG_KINIT_DEBUG > 1 ) 836 chdev_dir_display(); 837 #endif 829 838 830 839 // All cores enable the shared IPI channel … … 834 843 // All cores initialize specific core registers 835 844 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() );839 845 840 846 // all cores initialize the idle thread descriptor … … 855 861 core->scheduler.idle = thread; 856 862 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 ) 864 sched_display(); 865 #endif 866 866 867 867 // CPO in cluster 0 creates the VFS root … … 874 874 if( CONFIG_VFS_ROOT_IS_FATFS ) 875 875 { 876 // 1. createFATFS context in cluster 0876 // 1. allocate memory for FATFS context in cluster 0 877 877 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 878 878 … … 910 910 vfs_root_inode_xp, // VFS root 911 911 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 ); 912 917 } 913 918 else 914 919 { 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 920 924 process_zero.vfs_root_xp = vfs_root_inode_xp; 921 925 process_zero.vfs_cwd_xp = vfs_root_inode_xp; … … 945 949 if( CONFIG_VFS_ROOT_IS_FATFS ) 946 950 { 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 953 958 vfs_ctx_t * vfs_ctx = &fs_context[FS_TYPE_FATFS]; 954 959 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 956 968 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 ); 967 977 } 968 978 … … 1062 1072 { 1063 1073 process_init_create(); 1074 vfs_display( vfs_root_inode_xp ); 1064 1075 } 1065 1076 … … 1082 1093 print_banner( (info->x_size * info->y_size) , info->cores_nr ); 1083 1094 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" 1085 1096 " - thread descriptor : %d bytes\n" 1086 1097 " - process descriptor : %d bytes\n"
Note: See TracChangeset
for help on using the changeset viewer.