Changeset 322
- Timestamp:
- Jun 10, 2014, 1:28:14 PM (10 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/ctx_handler.c
r294 r322 83 83 // the NB_PROCS_MAX timers are system timers (TICK) 84 84 85 #if USE_X ICU85 #if USE_XCU 86 86 _xcu_timer_reset_cpt( cluster_xy, lpid ); 87 87 #else -
soft/giet_vm/giet_kernel/irq_handler.c
r310 r322 19 19 #include <bdv_driver.h> 20 20 #include <dma_driver.h> 21 #include <spi_driver.h> 21 22 #include <mapping_info.h> 22 23 #include <utils.h> 23 24 24 #if !defined( USE_X ICU )25 # error: You must define USE_X ICU in the hard_config.h file25 #if !defined( USE_XCU ) 26 # error: You must define USE_XCU in the hard_config.h file 26 27 #endif 27 28 … … 60 61 unsigned int icu_out_index = lpid * IRQ_PER_PROCESSOR; 61 62 62 #if USE_X ICU63 #if USE_XCU 63 64 _xcu_get_index( cluster_xy, icu_out_index, &irq_id, &irq_type ); 64 65 #else … … 118 119 else if ( isr_type == ISR_TIMER ) _timer_isr ( irq_type, irq_id, channel ); 119 120 else if ( isr_type == ISR_MMC ) _mmc_isr ( irq_type, irq_id, channel ); 121 else if ( isr_type == ISR_DMA ) _dma_isr ( irq_type, irq_id, channel ); 122 else if ( isr_type == ISR_SPI ) _spi_isr ( irq_type, irq_id, channel ); 120 123 else 121 124 { … … 146 149 unsigned int lpid = gpid % NB_PROCS_MAX; 147 150 148 // We don't take TTY lock to avoid deadlock 149 _puts("\n[GIET WARNING] IRQ handler called but no active IRQ on processor["); 150 _putd( x ); 151 _puts(","); 152 _putd( y ); 153 _puts(","); 154 _putd( lpid ); 155 _puts("] at cycle "); 156 _putd( _get_proctime() ); 157 _puts("\n "); 151 _printf("\n[GIET WARNING] IRQ handler called but no active IRQ " 152 "on processor[%d,%d,%d] at cycle %d\n", 153 x, y, lpid, _get_proctime() ); 158 154 } 159 155 -
soft/giet_vm/giet_kernel/irq_handler.h
r297 r322 32 32 ISR_CMA = 9, 33 33 ISR_MMC = 10, 34 ISR_DMA = 11, 35 ISR_SPI = 12, 34 36 }; 35 37 -
soft/giet_vm/giet_kernel/kernel.ld
r258 r322 12 12 SECTIONS 13 13 { 14 . = seg_kernel_code_base;14 . = kernel_code_vbase; 15 15 seg_kernel_code : 16 16 { … … 19 19 } 20 20 21 . = seg_kernel_data_base;21 . = kernel_data_vbase; 22 22 seg_kernel_data : 23 23 { … … 38 38 } 39 39 40 . = seg_kernel_uncdata_base;40 . = kernel_uncdata_vbase; 41 41 seg_kernel_uncdata : 42 42 { … … 44 44 } 45 45 46 . = seg_kernel_init_base;46 . = kernel_init_vbase; 47 47 seg_kernel_init : 48 48 { -
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] */ -
soft/giet_vm/giet_kernel/sys_handler.c
r301 r322 20 20 #include <fat32.h> 21 21 #include <utils.h> 22 #include <hard_config.h> 22 23 #include <giet_config.h> 23 24 #include <mapping_info.h> 25 26 #if !defined(SEG_BOOT_MAPPING_BASE) 27 # error: You must define SEG_BOOT_MAPPING_BASE in the hard_config.h file 28 #endif 24 29 25 30 //////////////////////////////////////////////////////////////////////////// … … 139 144 unsigned int* buffer) 140 145 { 141 mapping_header_t * header = (mapping_header_t *) &seg_boot_mapping_base;146 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 142 147 mapping_cluster_t * cluster = _get_cluster_base(header); 143 148 … … 186 191 mapping_vobj_t** res_vobj ) 187 192 { 188 mapping_header_t * header = (mapping_header_t *) &seg_boot_mapping_base;193 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 189 194 mapping_vspace_t * vspace = _get_vspace_base(header); 190 195 mapping_vobj_t * vobj = _get_vobj_base(header); … … 215 220 216 221 ///////////////////////////////////////////////////////////////////////////// 217 // This function writes in vobj_v addrthe virtual base address of a vobj222 // This function writes in vobj_vbase the virtual base address of a vobj 218 223 // identified by the (vspace_name / vobj_name ) couple. 219 224 // returns 0 if success, >0 if not found
Note: See TracChangeset
for help on using the changeset viewer.