Changeset 204 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Jul 17, 2017, 8:42:59 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r188 r204 33 33 #include <list.h> 34 34 #include <xlist.h> 35 #include <xhtab.h> 35 36 #include <thread.h> 36 37 #include <scheduler.h> … … 245 246 func = FUNC_FROM_TYPE( dev_tbl[i].type ); 246 247 impl = IMPL_FROM_TYPE( dev_tbl[i].type ); 247 248 248 249 ////////////////////////// 249 250 if( func == DEV_FUNC_MMC ) … … 553 554 } 554 555 555 kinit_dmsg("\n[INFO] %s created IOPIC chdev in cluster %x at cycle %d\n",556 kinit_dmsg("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n", 556 557 __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() ); 557 558 … … 672 673 void kernel_init( boot_info_t * info ) 673 674 { 674 lid_t core_lid = -1; // running core local index 675 cxy_t core_cxy = -1; // running core cluster identifier 676 gid_t core_gid; // running core hardware identifier 677 cluster_t * cluster; // pointer on local cluster manager 678 core_t * core; // pointer on running core descriptor 679 thread_t * thread; // pointer on idle thread descriptor 680 xptr_t vfs_root_inode_xp; // extended pointer on VFS root inode 681 // xptr_t devfs_root_inode_xp; // extended pointer on DEVFS root inode 675 lid_t core_lid = -1; // running core local index 676 cxy_t core_cxy = -1; // running core cluster identifier 677 gid_t core_gid; // running core hardware identifier 678 cluster_t * cluster; // pointer on local cluster manager 679 core_t * core; // pointer on running core descriptor 680 thread_t * thread; // pointer on idle thread descriptor 681 682 xptr_t vfs_root_inode_xp; // extended pointer on VFS root inode 683 xptr_t devfs_dev_inode_xp; // extended pointer on DEVFS dev inode 684 xptr_t devfs_external_inode_xp; // extended pointer on DEVFS external inode 685 xptr_t devfs_internal_inode_xp; // extended pointer on DEVFS internal inode 686 682 687 error_t error; 683 688 … … 958 963 959 964 ///////////////////////////////////////////////////////////////////////////////// 960 // global &local synchro to protect File System initialisation961 965 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ), 962 966 (info->x_size * info->y_size) ); 963 967 barrier_wait( &local_barrier , info->cores_nr ); 968 ///////////////////////////////////////////////////////////////////////////////// 964 969 965 970 if( (core_lid == 0) && (local_cxy == 0) ) … … 970 975 ///////////////////////////////////////////////////////////////////////////////// 971 976 // STEP 6 : CP0 in cluster IO makes the global DEVFS tree initialisation: 972 // It creates the DEVFS root directoryand the DEVFS "external"973 // dire tory in cluster IO and mount these inodes into VFS.977 // It creates the DEVFS directory "dev", and the DEVFS "external" 978 // directory in cluster IO and mount these inodes into VFS. 974 979 ///////////////////////////////////////////////////////////////////////////////// 975 980 976 981 if( (core_lid == 0) && (local_cxy == io_cxy) ) 977 982 { 978 xptr_t devfs_root_inode_xp; // extended pointer on DEVFS root directory979 xptr_t devfs_external_inode_xp; // extended pointer on DEVFS external directory980 981 983 // create "dev" and "external" directories. 982 984 devfs_global_init( process_zero.vfs_root_xp, 983 &devfs_ root_inode_xp,985 &devfs_dev_inode_xp, 984 986 &devfs_external_inode_xp ); 985 987 … … 991 993 992 994 // register DEVFS root and external directories 993 devfs_ctx_init( devfs_ctx, devfs_ root_inode_xp, devfs_external_inode_xp );995 devfs_ctx_init( devfs_ctx, devfs_dev_inode_xp, devfs_external_inode_xp ); 994 996 } 995 997 996 998 ///////////////////////////////////////////////////////////////////////////////// 997 // global &local synchro to protect File System initialisation998 999 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ), 999 1000 (info->x_size * info->y_size) ); 1000 1001 barrier_wait( &local_barrier , info->cores_nr ); 1002 ///////////////////////////////////////////////////////////////////////////////// 1001 1003 1002 1004 if( (core_lid == 0) && (local_cxy == 0) ) … … 1007 1009 // STEP 7 : All CP0s complete in parallel the DEVFS tree initialization. 1008 1010 // Each CP0 get the "dev" and "external" extended pointers from 1009 // values stor red in cluster IO. Then CP0 in cluster(i) creates the1010 // DEVFS "internal directory, and creates the pseudo-files for all1011 // chdevs containedin cluster (i).1011 // values stored in cluster IO. 1012 // Then CP0 in cluster(i) creates the DEVFS "internal directory, 1013 // and creates the pseudo-files for all chdevs in cluster (i). 1012 1014 ///////////////////////////////////////////////////////////////////////////////// 1013 1015 1014 1016 if( core_lid == 0 ) 1015 1017 { 1016 xptr_t root_inode_xp; // extended pointer on DEVFS root directory1017 xptr_t external_inode_xp; // extended pointer on DEVFS external directory1018 1019 1018 // get extended pointer on "extend" field of VFS context for DEVFS in cluster IO 1020 1019 xptr_t extend_xp = XPTR( io_cxy , &fs_context[FS_TYPE_DEVFS].extend ); … … 1023 1022 devfs_ctx_t * devfs_ctx = hal_remote_lpt( extend_xp ); 1024 1023 1025 root_inode_xp = hal_remote_lwd( XPTR( io_cxy , &devfs_ctx->root_inode_xp ) ); 1026 external_inode_xp = hal_remote_lwd( XPTR( io_cxy , &devfs_ctx->external_inode_xp ) ); 1027 1028 devfs_local_init( root_inode_xp, 1029 external_inode_xp ); 1030 } 1031 1032 ///////////////////////////////////////////////////////////////////////////////// 1033 // global &local synchro to protect File System initialisation 1024 devfs_dev_inode_xp = hal_remote_lwd( XPTR( io_cxy , 1025 &devfs_ctx->dev_inode_xp ) ); 1026 devfs_external_inode_xp = hal_remote_lwd( XPTR( io_cxy , 1027 &devfs_ctx->external_inode_xp ) ); 1028 1029 // populate DEVFS in all clusters 1030 devfs_local_init( devfs_dev_inode_xp, 1031 devfs_external_inode_xp, 1032 &devfs_internal_inode_xp ); 1033 } 1034 1035 ///////////////////////////////////////////////////////////////////////////////// 1034 1036 if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ), 1035 1037 (info->x_size * info->y_size) ); 1036 1038 barrier_wait( &local_barrier , info->cores_nr ); 1039 ///////////////////////////////////////////////////////////////////////////////// 1037 1040 1038 1041 if( (core_lid == 0) && (local_cxy == 0) ) … … 1040 1043 __FUNCTION__, (uint32_t)hal_time_stamp()); 1041 1044 1042 ///////////////////////////////////////////////////////////////////////////////// 1043 // STEP 8 : CP0 in I/O cluster creates the process_init and print banner. 1045 #if CONFIG_KINIT_DEBUG 1046 vfs_display( vfs_root_inode_xp ); 1047 #endif 1048 1049 ///////////////////////////////////////////////////////////////////////////////// 1050 // STEP 8 : CP0 in I/O cluster creates the first user process (process_init) 1044 1051 ///////////////////////////////////////////////////////////////////////////////// 1045 1052 … … 1050 1057 1051 1058 ///////////////////////////////////////////////////////////////////////////////// 1052 // global syncho to protect access to File System1053 1059 if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ), 1054 1060 (info->x_size * info->y_size) ); 1055 1061 barrier_wait( &local_barrier , info->cores_nr ); 1062 ///////////////////////////////////////////////////////////////////////////////// 1056 1063 1057 1064 if( (core_lid == 0) && (local_cxy == 0) )
Note: See TracChangeset
for help on using the changeset viewer.