Changeset 322 for soft/giet_vm/giet_kernel/kernel_init.c
- Timestamp:
- Jun 10, 2014, 1:28:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/kernel_init.c
r310 r322 71 71 #include <mips32_registers.h> 72 72 73 #if !defined(X_SIZE) 74 # error: You must define X_SIZE in the hard_config.h file 75 #endif 76 77 #if !defined(Y_SIZE) 78 # error: You must define Y_SIZE in the hard_config.h file 79 #endif 80 81 #if !defined(Y_WIDTH) 82 # error: You must define Y_WIDTH in the hard_config.h file 83 #endif 84 85 #if !defined(Y_WIDTH) 86 # error: You must define Y_WIDTH in the hard_config.h file 87 #endif 88 89 #if !defined(NB_PROCS_MAX) 90 # error: You must define NB_PROCS_MAX in the hard_config.h file 91 #endif 92 93 #if !defined(NB_TOTAL_PROCS) 94 # error: You must define NB_TOTAL_PROCS in the hard_config.h file 95 #endif 96 97 #if !defined(USE_XCU) 98 # error: You must define USE_XCU in the hard_config.h file 99 #endif 100 101 #if !defined(IDLE_TASK_INDEX) 102 # error: You must define IDLE_TASK_INDEX in the giet_config.h file 103 #endif 104 105 #if !defined(GIET_TICK_VALUE) 106 # error: You must define GIET_TICK_VALUE in the giet_config.h file 107 #endif 108 109 #if !defined(GIET_NB_VSPACE_MAX) 110 # error: You must define GIET_NB_VSPACE_MAX in the giet_config.h file 111 #endif 112 73 113 /////////////////////////////////////////////////////////////////////////////////// 74 114 // array of pointers on the page tables (virtual addresses) … … 110 150 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 111 151 unsigned int lpid = global_pid % NB_PROCS_MAX; 112 unsigned int nprocs = TOTAL_PROCS;113 152 unsigned int pid = ((( x * Y_SIZE) + y) * NB_PROCS_MAX) + lpid; 114 153 // unsigned int pid = _get_id(i n_procs ); … … 217 256 unsigned int channel = lpid * IRQ_PER_PROCESSOR; 218 257 219 #if USE_X ICU258 #if USE_XCU 220 259 _xcu_set_mask( cluster_xy, channel, hwi_mask, IRQ_TYPE_HWI ); 221 260 _xcu_set_mask( cluster_xy, channel, wti_mask, IRQ_TYPE_WTI ); … … 238 277 // start system timer 239 278 240 #if USE_X ICU279 #if USE_XCU 241 280 _xcu_timer_start( cluster_xy, isr_switch_index, GIET_TICK_VALUE ); 242 281 #else … … 296 335 x, y, lpid, _get_proctime() ); 297 336 298 /*299 unsigned int* pcount = &_init_barrier;300 unsigned int count;301 302 // increment barrier counter with atomic LL/SC303 asm volatile ( "_init_barrier_loop: \n"304 "ll %0, 0(%1) \n"305 "addi $3, %0, 1 \n"306 "sc $3, 0(%1) \n"307 "beqz $3, _init_barrier_loop \n"308 "nop \n"309 : "=&r"(count)310 : "r"(pcount)311 : "$3" );312 313 // busy waiting until all processors synchronized314 while ( *pcount != nprocs ) asm volatile ("nop");315 */316 317 337 // increment barrier counter 318 338 _init_barrier++; 319 339 320 340 // busy waiting until all processors synchronized 321 while ( _init_barrier != nprocs ) asm volatile ("nop"); 322 323 /* 324 _printf("\n[GIET] Processor[%d,%d,%d] jumps to user code at cycle %d\n", 325 x, y, lpid, _get_proctime() ); 326 */ 327 341 while ( _init_barrier != NB_TOTAL_PROCS ) asm volatile ("nop"); 342 328 343 // set registers and jump to user code 329 344 asm volatile ( "move $29, %0 \n" /* SP <= ctx[CTX_SP_ID] */
Note: See TracChangeset
for help on using the changeset viewer.