Changeset 547 for soft/giet_vm/giet_kernel/kernel_init.c
- Timestamp:
- Apr 5, 2015, 12:09:09 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/kernel_init.c
r536 r547 18 18 #include <fat32.h> 19 19 #include <xcu_driver.h> 20 #include <nic_driver.h> 21 #include <hba_driver.h> 20 22 #include <mmc_driver.h> 21 23 #include <ctx_handler.h> … … 144 146 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 145 147 unsigned int p = gpid & ((1<<P_WIDTH)-1); 146 147 //////////////////////////////////////////////////////////////////////////// 148 // Step 0 : P[0,0,0] initialises various global vaiables 149 //////////////////////////////////////////////////////////////////////////// 148 unsigned int unused; 149 150 //////////////////////////////////////////////////////////////////////////// 151 // Step 0 : P[0,0,0] initialises global variables and peripherals 152 //////////////////////////////////////////////////////////////////////////// 150 153 151 154 if ( gpid == 0 ) 152 155 { 153 // distributed kernel heap initialisation156 ////// distributed kernel heap initialisation 154 157 _heap_init(); 155 158 156 159 #if GIET_DEBUG_INIT 157 _nolock_printf("\n[DEBUG KERNEL_INIT] P[%d,%d,%d] completes kernel HEAP init\n", 158 x, y, p ); 159 #endif 160 // distributed lock for TTY0 160 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes kernel heap init\n", x, y, p ); 161 #endif 162 ////// distributed lock for TTY0 161 163 _sqt_lock_init( &_tty0_sqt_lock ); 162 164 163 165 #if GIET_DEBUG_INIT 164 _nolock_printf("\n[DEBUG KERNEL_INIT] P[%d,%d,%d] completes TTY0 lock init\n", 165 x , y , p ); 166 #endif 167 // distributed kernel barrier between all processors 166 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes TTY0 lock init\n", x , y , p ); 167 #endif 168 ////// distributed kernel barrier between all processors 168 169 _sqt_barrier_init( &_all_procs_barrier ); 169 170 170 171 #if GIET_DEBUG_INIT 171 _nolock_printf("\n[DEBUG KERNEL_INIT] P[%d,%d,%d] completes barrier init\n", 172 x , y , p ); 173 #endif 174 175 #if USE_PIC 176 177 // _ext_irq_index[isr][channel] initialisation 178 _ext_irq_init(); 179 180 // routing HBA IRQ to proc[0,0,0] EXT_IRQ_ONE 181 unsigned int unused = 0; 182 if ( USE_IOC_HBA ) _ext_irq_alloc( ISR_HBA , 0 , &unused ); 183 184 #if GIET_DEBUG_INIT 185 _nolock_printf("\n[DEBUG KERNEL_INIT] P[%d,%d,%d] completes ext_irq init\n", 186 x , y , p ); 187 #endif 188 189 #endif // USE_PIC 190 191 // release other processors 172 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes barrier init\n", x , y , p ); 173 #endif 174 175 ////// _ext_irq_index[isr][channel] initialisation 176 if ( USE_PIC ) _ext_irq_init(); 177 178 #if GIET_DEBUG_INIT 179 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes ext_irq init\n", x , y , p ); 180 #endif 181 182 ////// NIC peripheral initialization 183 if ( USE_NIC ) _nic_global_init( 1, // broadcast accepted 184 1, // bypass activated 185 0, // tdm non activated 186 0 ); // tdm period 187 #if GIET_DEBUG_INIT 188 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes NIC init\n", x , y , p ); 189 #endif 190 191 ////// HBA peripheral initialisation 192 if ( USE_IOC_HBA ) 193 { 194 _hba_init(); 195 196 // routing HBA IRQ to proc[0,0,0] 197 _ext_irq_alloc( ISR_HBA , 0 , &unused ); 198 } 199 200 #if GIET_DEBUG_INIT 201 _nolock_printf("\n[DEBUG KINIT] P[%d,%d,%d] completes HBA init\n", x , y , p ); 202 #endif 203 204 ////// release other processors 192 205 _kernel_init_done = 1; 193 206 } … … 209 222 210 223 #if GIET_DEBUG_INIT 211 _printf("\n[DEBUG K ERNEL_INIT] P[%d,%d,%d] initialises SCHED array\n"224 _printf("\n[DEBUG KINIT] P[%d,%d,%d] initialises SCHED array\n" 212 225 " - scheduler vbase = %x\n" 213 226 " - tasks = %d\n", … … 255 268 256 269 #if GIET_DEBUG_INIT 257 _printf("\n[DEBUG K ERNEL_INIT] P[%d,%d,%d] initialises PTABS arrays"270 _printf("\n[DEBUG KINIT] P[%d,%d,%d] initialises PTABS arrays" 258 271 " and context for task %d \n" 259 272 " - ptabs_vaddr[%d][%d][%d] = %x\n" … … 297 310 298 311 #if GIET_DEBUG_INIT 299 _printf("\n[DEBUG K ERNEL_INIT] P[%d,%d,%d] initializes idle_task and starts TICK\n",312 _printf("\n[DEBUG KINIT] P[%d,%d,%d] initializes idle_task and starts TICK\n", 300 313 x, y, p ); 301 314 #endif … … 306 319 307 320 #if GIET_DEBUG_INIT 308 _printf("\n[DEBUG K ERNEL_INIT] P[%d,%d,%d] completes kernel FAT init\n",321 _printf("\n[DEBUG KINIT] P[%d,%d,%d] completes kernel FAT init\n", 309 322 x, y, p ); 310 323 #endif … … 334 347 335 348 #if GIET_DEBUG_INIT 336 _printf("\n[DEBUG K ERNEL_INIT] P[%d,%d,%d] jumps to user code at cycle %d\n"349 _printf("\n[DEBUG KINIT] P[%d,%d,%d] jumps to user code at cycle %d\n" 337 350 " ltid = %d / sp = %x / sr = %x / ptpr = %x / epc = %x\n", 338 351 x , y , p , _get_proctime() ,
Note: See TracChangeset
for help on using the changeset viewer.