Changeset 457 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r443 r457 25 25 #include <kernel_config.h> 26 26 #include <errno.h> 27 #include <hal_ types.h>27 #include <hal_kernel_types.h> 28 28 #include <hal_special.h> 29 29 #include <hal_context.h> … … 186 186 " /_/ \\_\\ |______| |_| |_| \\_____/ |______/ |_| |_| |_| \\_\\ |_| |_| \n" 187 187 "\n\n\t\t Advanced Locality Management Operating System / Multi Kernel Hybrid\n" 188 "\n\n\t\t Version 0.0 / %d cluster(s) / %d core(s) per cluster / cycle %d\n\n",189 nclusters , ncores , hal_time_stamp());188 "\n\n\t\t %s / %d cluster(s) / %d core(s) per cluster\n\n", 189 CONFIG_ALMOS_VERSION , nclusters , ncores ); 190 190 } 191 191 … … 761 761 reg_t status; // running core status register 762 762 763 cxy_t io_cxy = info->io_cxy;764 765 assert( (io_cxy == ((info->x_size - 1)<<(info->y_width)) + (info->y_size - 1)) ,766 __FUNCTION__ , "illegal IO cluter identifier\n" );767 768 763 ///////////////////////////////////////////////////////////////////////////////// 769 764 // STEP 0 : Each core get its core identifier from boot_info, and makes … … 796 791 thread->remote_locks = 0; 797 792 798 // CP0 in I/O clusterinitialises TXT0 chdev descriptor799 if( (core_lid == 0) && (core_cxy == io_cxy) ) txt0_device_init( info );800 801 ///////////////////////////////////////////////////////////////////////////////// 802 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),793 // CP0 in cluster 0 initialises TXT0 chdev descriptor 794 if( (core_lid == 0) && (core_cxy == 0) ) txt0_device_init( info ); 795 796 ///////////////////////////////////////////////////////////////////////////////// 797 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 803 798 (info->x_size * info->y_size) ); 804 799 barrier_wait( &local_barrier , info->cores_nr ); … … 838 833 839 834 ///////////////////////////////////////////////////////////////////////////////// 840 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),835 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 841 836 (info->x_size * info->y_size) ); 842 837 barrier_wait( &local_barrier , info->cores_nr ); … … 865 860 866 861 //////////////////////////////////////////////////////////////////////////////// 867 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),862 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 868 863 (info->x_size * info->y_size) ); 869 864 barrier_wait( &local_barrier , info->cores_nr ); … … 898 893 899 894 ///////////////////////////////////////////////////////////////////////////////// 900 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),895 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 901 896 (info->x_size * info->y_size) ); 902 897 barrier_wait( &local_barrier , info->cores_nr ); … … 926 921 927 922 // all cores initialize the idle thread descriptor 928 error = thread_idle_init( thread, 929 THREAD_IDLE, 930 &thread_idle_func, 931 NULL, 932 core_lid ); 933 if( error ) 934 { 935 assert( false , __FUNCTION__ , 936 "core[%x][%d] cannot initialize idle thread", local_cxy , core_lid ); 937 } 923 thread_idle_init( thread, 924 THREAD_IDLE, 925 &thread_idle_func, 926 NULL, 927 core_lid ); 938 928 939 929 // all cores unblock idle thread, and register it in scheduler … … 1008 998 1009 999 ///////////////////////////////////////////////////////////////////////////////// 1010 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),1000 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 1011 1001 (info->x_size * info->y_size) ); 1012 1002 barrier_wait( &local_barrier , info->cores_nr ); … … 1069 1059 1070 1060 ///////////////////////////////////////////////////////////////////////////////// 1071 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),1061 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 1072 1062 (info->x_size * info->y_size) ); 1073 1063 barrier_wait( &local_barrier , info->cores_nr ); … … 1076 1066 #if DEBUG_KERNEL_INIT 1077 1067 if( (core_lid == 0) & (local_cxy == 0) ) 1078 printk("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster %x/ cycle %d\n",1079 __FUNCTION__, vfs_root_inode_xp , io_cxy ,(uint32_t)hal_get_cycles());1068 printk("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster 0 / cycle %d\n", 1069 __FUNCTION__, vfs_root_inode_xp , (uint32_t)hal_get_cycles()); 1080 1070 #endif 1081 1071 … … 1086 1076 ///////////////////////////////////////////////////////////////////////////////// 1087 1077 1088 if( (core_lid == 0) && (local_cxy == io_cxy) )1078 if( (core_lid == 0) && (local_cxy == 0) ) 1089 1079 { 1090 1080 // create "dev" and "external" directories. … … 1104 1094 1105 1095 ///////////////////////////////////////////////////////////////////////////////// 1106 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),1096 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 1107 1097 (info->x_size * info->y_size) ); 1108 1098 barrier_wait( &local_barrier , info->cores_nr ); … … 1111 1101 #if DEBUG_KERNEL_INIT 1112 1102 if( (core_lid == 0) & (local_cxy == 0) ) 1113 printk("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster %x/ cycle %d\n",1114 __FUNCTION__, devfs_dev_inode_xp , io_cxy ,(uint32_t)hal_get_cycles() );1103 printk("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster 0 / cycle %d\n", 1104 __FUNCTION__, devfs_dev_inode_xp , (uint32_t)hal_get_cycles() ); 1115 1105 #endif 1116 1106 … … 1125 1115 if( core_lid == 0 ) 1126 1116 { 1127 // get extended pointer on "extend" field of VFS context for DEVFS in cluster IO1128 xptr_t extend_xp = XPTR( io_cxy, &fs_context[FS_TYPE_DEVFS].extend );1129 1130 // get pointer on DEVFS context in cluster IO1117 // get extended pointer on "extend" field of VFS context for DEVFS in cluster 0 1118 xptr_t extend_xp = XPTR( 0 , &fs_context[FS_TYPE_DEVFS].extend ); 1119 1120 // get pointer on DEVFS context in cluster 0 1131 1121 devfs_ctx_t * devfs_ctx = hal_remote_lpt( extend_xp ); 1132 1122 1133 devfs_dev_inode_xp = hal_remote_lwd( XPTR( io_cxy , 1134 &devfs_ctx->dev_inode_xp ) ); 1135 devfs_external_inode_xp = hal_remote_lwd( XPTR( io_cxy , 1136 &devfs_ctx->external_inode_xp ) ); 1123 devfs_dev_inode_xp = hal_remote_lwd( XPTR( 0 , &devfs_ctx->dev_inode_xp ) ); 1124 devfs_external_inode_xp = hal_remote_lwd( XPTR( 0 , &devfs_ctx->external_inode_xp ) ); 1137 1125 1138 1126 // populate DEVFS in all clusters … … 1143 1131 1144 1132 ///////////////////////////////////////////////////////////////////////////////// 1145 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),1133 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 1146 1134 (info->x_size * info->y_size) ); 1147 1135 barrier_wait( &local_barrier , info->cores_nr ); … … 1158 1146 ///////////////////////////////////////////////////////////////////////////////// 1159 1147 1160 if( (core_lid == 1148 if( (core_lid == 0) && (local_cxy == 0) ) 1161 1149 { 1162 1150 … … 1169 1157 1170 1158 ///////////////////////////////////////////////////////////////////////////////// 1171 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy, &global_barrier ),1159 if( core_lid == 0 ) remote_barrier( XPTR( 0 , &global_barrier ), 1172 1160 (info->x_size * info->y_size) ); 1173 1161 barrier_wait( &local_barrier , info->cores_nr ); … … 1189 1177 ///////////////////////////////////////////////////////////////////////////////// 1190 1178 1191 if( (core_lid == 0) && (local_cxy == io_cxy) )1179 if( (core_lid == 0) && (local_cxy == 0) ) 1192 1180 { 1193 1181 print_banner( (info->x_size * info->y_size) , info->cores_nr );
Note: See TracChangeset
for help on using the changeset viewer.