Changeset 50 for trunk/kernel/kern
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (7 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/cluster.c
r23 r50 28 28 #include <hal_atomic.h> 29 29 #include <hal_special.h> 30 #include <hal_ppm.h> 30 31 #include <printk.h> 31 32 #include <errno.h> … … 43 44 #include <dqdt.h> 44 45 45 // TODO #include <sysfs.h>46 47 46 /////////////////////////////////////////////////////////////////////////////////////////// 48 47 // Extern global variables … … 62 61 error_t cluster_init( struct boot_info_s * info ) 63 62 { 63 error_t error; 64 64 lpid_t lpid; // local process_index 65 65 lid_t lid; // local core index … … 82 82 spinlock_init( &cluster->kcm_lock ); 83 83 84 cluster_dmsg("\n[INFO] %s for cluster %x enters\n", 85 __FUNCTION__ , local_cxy ); 86 84 87 // initialises DQDT 85 88 cluster->dqdt_root_level = dqdt_init( info->x_size, … … 90 93 91 94 // initialises embedded PPM 92 ppm_init( &cluster->ppm, 93 info->pages_nr, 94 info->pages_offset ); 95 error = hal_ppm_init( info ); 96 97 if( error ) 98 { 99 printk("\n[ERROR] in %s : cannot initialize PPM in cluster %x\n", 100 __FUNCTION__ , local_cxy ); 101 return ENOMEM; 102 } 103 104 cluster_dmsg("\n[INFO] %s : PPM initialized in cluster %x at cycle %d\n", 105 __FUNCTION__ , local_cxy , hal_time_stamp() ); 95 106 96 107 // initialises embedded KHM 97 108 khm_init( &cluster->khm ); 98 109 110 cluster_dmsg("\n[INFO] %s : KHM initialized in cluster %x at cycle %d\n", 111 __FUNCTION__ , local_cxy , hal_time_stamp() ); 112 99 113 // initialises embedded KCM 100 114 kcm_init( &cluster->kcm , KMEM_KCM ); 115 116 cluster_dmsg("\n[INFO] %s : KCM initialized in cluster %x at cycle %d\n", 117 __FUNCTION__ , local_cxy , hal_time_stamp() ); 101 118 102 119 // initialises all cores descriptors … … 108 125 } 109 126 127 cluster_dmsg("\n[INFO] %s : cores initialized in cluster %x at cycle %d\n", 128 __FUNCTION__ , local_cxy , hal_time_stamp() ); 129 110 130 // initialises RPC fifo 111 131 rpc_fifo_init( &cluster->rpc_fifo ); 132 133 cluster_dmsg("\n[INFO] %s : RPC fifo inialized in cluster %x at cycle %d\n", 134 __FUNCTION__ , local_cxy , hal_time_stamp() ); 112 135 113 136 // initialise pref_tbl[] in process manager … … 132 155 xlist_root_init( XPTR( local_cxy , &cluster->pmgr.copies_root[lpid] ) ); 133 156 } 157 158 cluster_dmsg("\n[INFO] %s Process Manager initialized in cluster %x at cycle %d\n", 159 __FUNCTION__ , local_cxy , hal_time_stamp() ); 134 160 135 161 hal_wbflush(); -
trunk/kernel/kern/cluster.h
r23 r50 133 133 134 134 pmgr_t pmgr; /*! embedded process manager */ 135 136 char name[CONFIG_SYSFS_NAME_LEN];137 138 // sysfs_entry_t node;139 135 } 140 136 cluster_t; -
trunk/kernel/kern/do_syscall.c
r23 r50 81 81 sys_chmod, // 31 82 82 sys_signal, // 32 83 sys_ gettimeofday,// 3383 sys_timeofday, // 33 84 84 sys_kill, // 34 85 85 sys_getpid, // 35 -
trunk/kernel/kern/kernel_init.c
r25 r50 55 55 #include <devfs.h> 56 56 57 // TODO #include <sysfs.h>58 57 59 58 #define KERNEL_INIT_SYNCHRO 0xA5A5B5B5 … … 115 114 __attribute__((section(".kdata"))) 116 115 barrier_t local_barrier CONFIG_CACHE_LINE_ALIGNED; 116 117 // This variable defines the array of supported File System contexts 118 __attribute__((section(".kdata"))) 119 vfs_ctx_t fs_context[FS_TYPES_NR] CONFIG_CACHE_LINE_ALIGNED; 120 117 121 118 122 /////////////////////////////////////////////////////////////////////////////////////////// … … 293 297 } 294 298 295 kinit_dmsg("\n[INFO] %s : core[%x][0] create sICU chdev at cycle %d\n",299 kinit_dmsg("\n[INFO] %s : core[%x][0] created ICU chdev at cycle %d\n", 296 300 __FUNCTION__ , local_cxy , hal_time_stamp() ); 297 301 … … 335 339 } 336 340 337 kinit_dmsg("\n[INFO] %s : core[%x][0] create sMMC chdev at cycle %d\n",341 kinit_dmsg("\n[INFO] %s : core[%x][0] created MMC chdev at cycle %d\n", 338 342 __FUNCTION__ , local_cxy , hal_time_stamp() ); 339 343 } … … 370 374 chdev_dir.dma[channel] = chdev_xp; 371 375 372 kinit_dmsg("\n[INFO] %s : core[%x][0] create sDMA[%d] chdev at cycle %d\n",376 kinit_dmsg("\n[INFO] %s : core[%x][0] created DMA[%d] chdev at cycle %d\n", 373 377 __FUNCTION__ , local_cxy , channel , hal_time_stamp() ); 374 378 } … … 395 399 // 396 400 // TODO check that cluster IO contains a PIC [AG] 401 // TODO make a default initialisation for the chdev_dir structure (XPTR_NULL ) [AG] 397 402 /////////////////////////////////////////////////////////////////////////////////////////// 398 403 // @ info : pointer on the local boot-info structure. … … 713 718 // CP0 allocates one WTI mailbbox per core for Inter Processor Interrupt 714 719 // this must be done after ICU chdev initialisation, by CP0 only, and before 715 // external devices initialisation to enforce the rule (wti_id == lid) 720 // external devices initialisation to enforce the rule : 721 // "The WTI index for the IPI routed to core[lid] is lid" 716 722 if( core_lid == 0 ) 717 723 { … … 733 739 } 734 740 735 // CP0contribute to initialise external peripheral chdev descriptors.741 // All CP0s contribute to initialise external peripheral chdev descriptors. 736 742 // Each CP0[cxy] scan the set of external (shared) peripherals (but the TXT0), 737 743 // and allocates memory for the chdev descriptors that must be placed … … 779 785 } 780 786 781 printk("\n bloup 0\n");782 783 787 // CP0 in all clusters initializes cooperatively VFS and DEVFS 784 788 if( (core_lid == 0) ) … … 786 790 xptr_t root_inode_xp; 787 791 788 // initialize root File System 792 // initialize root File System (must be FATFS in this implementation) 789 793 if( CONFIG_VFS_ROOT_IS_FATFS ) 790 794 { … … 804 808 } 805 809 806 printk("\n bloup 1\n");807 808 810 // mount the DEVFS File system 809 811 devfs_mount( root_inode_xp , "dev" ); 810 812 } 811 812 printk("\n bloup 2\n");813 813 814 814 // CP0 in I/O cluster print banner … … 844 844 845 845 // each core jump to idle thread 846 // asm volatile( "j thread_idle_func\n");846 thread_idle_func(); 847 847 848 848 } // end kernel_init() -
trunk/kernel/kern/printk.h
r23 r50 100 100 /////////////////////////////////////////////////////////////////////////////////// 101 101 102 #if CONFIG_CLUSTER_DEBUG 103 #define cluster_dmsg(...) printk(__VA_ARGS__) 104 #else 105 #define cluster_dmsg(...) 106 #endif 107 102 108 #if CONFIG_CONTEXT_DEBUG 103 109 #define context_dmsg(...) printk(__VA_ARGS__) … … 112 118 #endif 113 119 120 #if CONFIG_DEVFS_DEBUG 121 #define devfs_dmsg(...) printk(__VA_ARGS__) 122 #else 123 #define devfs_dmsg(...) 124 #endif 125 126 #if CONFIG_DMA_DEBUG 127 #define dma_dmsg(...) printk(__VA_ARGS__) 128 #else 129 #define dma_dmsg(...) 130 #endif 131 114 132 #if CONFIG_DQDT_DEBUG 115 133 #define dma_dmsg(...) printk(__VA_ARGS__) … … 136 154 #endif 137 155 156 #if CONFIG_FATFS_DEBUG 157 #define fatfs_dmsg(...) printk(__VA_ARGS__) 158 #else 159 #define fatfs_dmsg(...) 160 #endif 161 138 162 #if CONFIG_FBF_DEBUG 139 163 #define fbf_dmsg(...) printk(__VA_ARGS__) … … 152 176 #else 153 177 #define icu_dmsg(...) 178 #endif 179 180 #if CONFIG_IDLE_DEBUG 181 #define idle_dmsg(...) printk(__VA_ARGS__) 182 #else 183 #define idle_dmsg(...) 154 184 #endif 155 185 -
trunk/kernel/kern/thread.c
r23 r50 749 749 while( 1 ) 750 750 { 751 thread_dmsg("\n[INFO] %s : core[%x][%d] goes to sleep at cycle %d\n",751 idle_dmsg("\n[INFO] %s : core[%x][%d] goes to sleep at cycle %d\n", 752 752 __FUNCTION__ , local_cxy , lid , hal_time_stamp() ); 753 753 … … 755 755 hal_core_sleep(); 756 756 757 thread_dmsg("\n[INFO] %s : core[%x][%d] wake up at cycle %d\n",757 idle_dmsg("\n[INFO] %s : core[%x][%d] wake up at cycle %d\n", 758 758 __FUNCTION__ , local_cxy , lid , hal_time_stamp() ); 759 759
Note: See TracChangeset
for help on using the changeset viewer.