Changeset 296 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Jul 31, 2017, 1:59:52 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r285 r296 29 29 #include <hal_context.h> 30 30 #include <hal_irqmask.h> 31 #include <hal_ppm.h> 31 32 #include <barrier.h> 32 33 #include <remote_barrier.h> … … 784 785 785 786 if( (core_lid == 0) && (local_cxy == 0) ) 786 kinit_dmsg("\n[INFO] %s exit barrier 0 at cycle %d : TXT0 initialized\n",787 __FUNCTION__, (uint32_t)hal_time_stamp());787 kinit_dmsg("\n[INFO] %s : exit barrier 0 : TXT0 initialized / cycle %d\n", 788 __FUNCTION__, hal_time_stamp() ); 788 789 789 790 ///////////////////////////////////////////////////////////////////////////// … … 822 823 823 824 if( (core_lid == 0) && (local_cxy == 0) ) 824 kinit_dmsg("\n[INFO] %s exit barrier 1 at cycle %d : clusters initialised\n",825 __FUNCTION__, (uint32_t)hal_time_stamp());825 kinit_dmsg("\n[INFO] %s : exit barrier 1 : clusters initialised / cycle %d\n", 826 __FUNCTION__, hal_time_stamp() ); 826 827 827 828 ///////////////////////////////////////////////////////////////////////////////// 828 829 // STEP 2 : all CP0s initialize the process_zero descriptor. 829 // CP0 in cluster 0 initiali ses the IOPIC device.830 // CP0 in cluster 0 initializes the IOPIC device. 830 831 ///////////////////////////////////////////////////////////////////////////////// 831 832 … … 847 848 848 849 if( (core_lid == 0) && (local_cxy == 0) ) 849 kinit_dmsg("\n[INFO] %s exit barrier 2 at cycle %d : PIC initialised\n",850 __FUNCTION__, (uint32_t)hal_time_stamp());850 kinit_dmsg("\n[INFO] %s : exit barrier 2 : PIC initialised / cycle %d\n", 851 __FUNCTION__, hal_time_stamp() ); 851 852 852 853 //////////////////////////////////////////////////////////////////////////////// 853 // STEP 3 : all CP0s complete the distibuted LAPIC initialization.854 // all CP0s initialize the irinternal chdev descriptors855 // all CP0s initialize the irlocal external chdev descriptors854 // STEP 3 : all CP0s initialize the distibuted LAPIC descriptor. 855 // all CP0s initialize the internal chdev descriptors 856 // all CP0s initialize the local external chdev descriptors 856 857 //////////////////////////////////////////////////////////////////////////////// 857 858 … … 878 879 879 880 if( (core_lid == 0) && (local_cxy == 0) ) 880 kinit_dmsg("\n[INFO] %s exit barrier 3 at cycle %d : all chdev initialised\n",881 __FUNCTION__, (uint32_t)hal_time_stamp());881 kinit_dmsg("\n[INFO] %s : exit barrier 3 : all chdev initialised / cycle %d\n", 882 __FUNCTION__, hal_time_stamp()); 882 883 883 884 ///////////////////////////////////////////////////////////////////////////////// 884 885 // STEP 4 : All cores enable IPI (Inter Procesor Interrupt), 886 // All cores initialise specific core registers 885 887 // Alh cores initialize IDLE thread. 886 888 // Only CP0 in cluster 0 creates the VFS root inode. … … 891 893 892 894 // All cores enable the shared IPI channel 893 894 // @@@895 hal_set_ebase( 0x1000 );896 // @@@897 898 895 dev_pic_enable_ipi(); 899 896 hal_enable_irq( &status ); 900 897 898 // All cores initialize specific core registers 899 hal_core_init( info ); 900 901 901 kinit_dmsg("\n[INFO] %s : IRQs enabled for core[%x,%d] / SR = %x\n", 902 902 __FUNCTION__ , local_cxy , core_lid , hal_get_sr() ); 903 903 904 // all cores create the idle thread descriptor904 // all cores initialize the idle thread descriptor 905 905 error = thread_kernel_init( thread, 906 906 THREAD_IDLE, … … 915 915 } 916 916 917 // all cores register idle thread in scheduler 917 // all cores unblock idle thread, and register it in scheduler 918 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL ); 918 919 core->scheduler.idle = thread; 919 920 920 // all core activate the idle thread921 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );922 923 921 if( (core_lid == 0) && (local_cxy == 0) ) 924 922 { 925 kinit_dmsg("\n[INFO] %s : created idle thread %x at cycle %d\n", 926 __FUNCTION__ , thread , (uint32_t)hal_time_stamp()); 927 } 923 kinit_dmsg("\n[INFO] %s : initialized idle thread %x on core[%x,%d] / cycle %d\n", 924 __FUNCTION__ , thread->trdid , local_cxy, core_lid, (uint32_t)hal_time_stamp()); 925 } 926 927 #if CONFIG_KINIT_DEBUG 928 sched_display(); 929 #endif 928 930 929 931 // CPO in cluster 0 creates the VFS root … … 991 993 992 994 if( (core_lid == 0) && (local_cxy == 0) ) 993 kinit_dmsg("\n[INFO] %s exit barrier 4 at cycle %d : VFS OK in cluster 0\n",994 __FUNCTION__, (uint32_t)hal_time_stamp());995 kinit_dmsg("\n[INFO] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n", 996 __FUNCTION__, vfs_root_inode_xp , hal_time_stamp()); 995 997 996 998 ///////////////////////////////////////////////////////////////////////////////// … … 1010 1012 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 1011 1013 1012 assert( (fatfs_ctx != NULL) , __FUNCTION__ , 1013 "cannot create FATFS context\n" ); 1014 assert( (fatfs_ctx != NULL) , __FUNCTION__ , "cannot create FATFS context\n" ); 1014 1015 1015 1016 // get local pointer on VFS context for FATFS … … 1031 1032 1032 1033 // get extended pointer on VFS root inode from cluster 0 1033 vfs_root_inode_xp = hal_remote_lwd( XPTR( 0 , process_zero.vfs_root_xp ) );1034 vfs_root_inode_xp = hal_remote_lwd( XPTR( 0 , &process_zero.vfs_root_xp ) ); 1034 1035 1035 1036 // update local process_zero descriptor … … 1044 1045 ///////////////////////////////////////////////////////////////////////////////// 1045 1046 1046 // if( (core_lid == 0) && (local_cxy == 0) ) 1047 kinit_dmsg("\n[INFO] %s exit barrier 5 at cycle %d : VFS OK in all clusters\n", 1048 __FUNCTION__, (uint32_t)hal_time_stamp()); 1049 1047 if( (core_lid == 0) && (local_cxy == io_cxy) ) 1048 kinit_dmsg("\n[INFO] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n", 1049 __FUNCTION__, vfs_root_inode_xp , hal_time_stamp() ); 1050 1050 1051 1051 ///////////////////////////////////////////////////////////////////////////////// … … 1072 1072 } 1073 1073 1074 printk("\n@@@ %s : cluster %x reach barrier 6\n", __FUNCTION__ , local_cxy );1075 1076 1074 ///////////////////////////////////////////////////////////////////////////////// 1077 1075 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ), … … 1080 1078 ///////////////////////////////////////////////////////////////////////////////// 1081 1079 1082 // if( (core_lid == 0) && (local_cxy == 0) )1083 kinit_dmsg("\n[INFO] %s exit barrier 6 at cycle %d : DEVFS OK in cluster IO\n",1084 __FUNCTION__, (uint32_t)hal_time_stamp());1080 if( (core_lid == 0) && (local_cxy == io_cxy) ) 1081 kinit_dmsg("\n[INFO] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n", 1082 __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() ); 1085 1083 1086 1084 ///////////////////////////////////////////////////////////////////////////////// … … 1118 1116 1119 1117 if( (core_lid == 0) && (local_cxy == 0) ) 1120 kinit_dmsg("\n[INFO] %s exit barrier 7 at cycle %d : DEVFS OK in all clusters\n",1121 __FUNCTION__, (uint32_t)hal_time_stamp());1118 kinit_dmsg("\n[INFO] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n", 1119 __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() ); 1122 1120 1123 1121 #if CONFIG_KINIT_DEBUG … … 1141 1139 1142 1140 if( (core_lid == 0) && (local_cxy == 0) ) 1143 kinit_dmsg("\n[INFO] %s exit barrier 8 at cycle %d : process init created\n",1144 __FUNCTION__ , (uint32_t)hal_time_stamp() );1141 kinit_dmsg("\n[INFO] %s : exit barrier 8 : process init created / cycle %d\n", 1142 __FUNCTION__ , hal_time_stamp() ); 1145 1143 1146 1144 ///////////////////////////////////////////////////////////////////////////////// … … 1198 1196 dev_pic_enable_timer( CONFIG_SCHED_TICK_PERIOD ); 1199 1197 1200 if( (core_lid == 0) && (local_cxy == io_cxy) )1201 thread_dmsg("\n[INFO] %s complete kernel init in cluster 0 at cycle %d\n"1202 __FUNCTION__ , (uint32_t)hal_time_stamp() )1203 1204 1198 // each core jump to idle thread 1205 1199 thread_idle_func();
Note: See TracChangeset
for help on using the changeset viewer.