Changeset 320 for soft/giet_vm/giet_drivers/bdv_driver.c
- Timestamp:
- Jun 10, 2014, 12:33:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r313 r320 42 42 // An error code is returned if these conditions are not verified. 43 43 // 44 // The "seg_ioc_base" must be defined in giet_vsegs.ldfile.44 // The SEG_IOC_BASE address must be defined in the hard_config.h file. 45 45 /////////////////////////////////////////////////////////////////////////////////// 46 46 // Implementation notes: … … 55 55 56 56 #include <giet_config.h> 57 #include <hard_config.h> 57 58 #include <bdv_driver.h> 58 59 #include <xcu_driver.h> … … 77 78 unsigned int _bdv_get_register( unsigned int index ) 78 79 { 79 unsigned int* vaddr = (unsigned int*) &seg_ioc_base+ index;80 unsigned int* vaddr = (unsigned int*)SEG_IOC_BASE + index; 80 81 return _io_extended_read( vaddr ); 81 82 } … … 87 88 unsigned int value ) 88 89 { 89 unsigned int* vaddr = (unsigned int*) &seg_ioc_base+ index;90 unsigned int* vaddr = (unsigned int*)SEG_IOC_BASE + index; 90 91 _io_extended_write( vaddr, value ); 91 92 } … … 185 186 _it_disable( &save_sr ); 186 187 188 187 189 // set _bdv_gtid and reset runnable 188 190 _bdv_gtid = (gpid<<16) + ltid; … … 300 302 unsigned int channel ) // unused 301 303 { 302 unsigned int procid = _get_procid();303 unsigned int cluster_xy = procid / NB_PROCS_MAX;304 unsigned int lpid = procid % NB_PROCS_MAX;305 306 304 // get BDV status (and reset IRQ) 307 305 unsigned int status = _bdv_get_register( BLOCK_DEVICE_STATUS ); … … 311 309 (status == BLOCK_DEVICE_BUSY) ) return; 312 310 313 // reset WTI in XCU if WTI type314 if ( irq_type == IRQ_TYPE_WTI )315 {316 unsigned int value;317 _xcu_get_wti_value( cluster_xy, irq_id, &value );318 }319 320 311 // save status in kernel buffer _bdv_status 321 312 _bdv_status = status; 322 313 323 314 // identify task waiting on BDV 324 unsigned int rprocid = _bdv_gtid>>16; 325 unsigned int ltid = _bdv_gtid & 0xFFFF; 326 unsigned int remote_xy = rprocid / NB_PROCS_MAX; 315 unsigned int rprocid = _bdv_gtid>>16; 316 unsigned int ltid = _bdv_gtid & 0xFFFF; 317 unsigned int remote_xy = rprocid / NB_PROCS_MAX; 318 unsigned int remote_lpid = rprocid % NB_PROCS_MAX; 327 319 328 320 // re-activates sleeping task … … 333 325 334 326 // requires a context switch for remote processor running the waiting task 335 _xcu_send_wti( remote_xy, // cluster index336 lpid, //local processor index327 _xcu_send_wti( remote_xy, // remote cluster index 328 remote_lpid, // remote local processor index 337 329 0 ); // don't force context switch if not idle 338 330 339 331 #if GIET_DEBUG_IRQS // we don't take the TTY lock to avoid deadlock 332 unsigned int procid = _get_procid(); 333 unsigned int cluster_xy = procid / NB_PROCS_MAX; 334 unsigned int lpid = procid % NB_PROCS_MAX; 340 335 unsigned int x = cluster_xy >> Y_WIDTH; 341 336 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 342 337 unsigned int rx = remote_xy >> Y_WIDTH; 343 338 unsigned int ry = remote_xy & ((1<<Y_WIDTH)-1); 344 unsigned int rlpid = rprocid % NB_PROCS_MAX;345 339 _puts("\n[IRQS DEBUG] Processor["); 346 340 _putd(x ); … … 358 352 _putd(ry ); 359 353 _puts(","); 360 _putd(r lpid );354 _putd(remote_lpid ); 361 355 _puts(" / bdv status = "); 362 356 _putx(_bdv_status );
Note: See TracChangeset
for help on using the changeset viewer.