Changeset 728 for soft/giet_vm/giet_drivers/bdv_driver.c
- Timestamp:
- Nov 21, 2015, 2:53:00 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r715 r728 97 97 unsigned int status; 98 98 99 // get the BDV lock and register it in task context100 static_scheduler_t* psched = _get_sched();101 unsigned int ltid = _get_thread_ltid();102 _spin_lock_acquire( &_bdv_lock );103 _atomic_or( &psched->context[ltid].slot[CTX_LOCKS_ID] , LOCKS_MASK_BDV );104 105 // set device registers106 _bdv_set_register( BLOCK_DEVICE_BUFFER , (unsigned int)buf_paddr );107 _bdv_set_register( BLOCK_DEVICE_BUFFER_EXT, (unsigned int)(buf_paddr>>32) );108 _bdv_set_register( BLOCK_DEVICE_COUNT , count );109 _bdv_set_register( BLOCK_DEVICE_LBA , lba );110 111 99 #if USE_IOB // software L2/L3 cache coherence 112 100 if ( to_mem ) _mmc_inval( buf_paddr, count<<9 ); … … 120 108 if ( use_irq == 0 ) 121 109 { 110 // set device registers 111 _bdv_set_register( BLOCK_DEVICE_BUFFER , (unsigned int)buf_paddr ); 112 _bdv_set_register( BLOCK_DEVICE_BUFFER_EXT, (unsigned int)(buf_paddr>>32) ); 113 _bdv_set_register( BLOCK_DEVICE_COUNT , count ); 114 _bdv_set_register( BLOCK_DEVICE_LBA , lba ); 115 122 116 // Launch transfert 123 117 if (to_mem == 0) _bdv_set_register( BLOCK_DEVICE_OP, BLOCK_DEVICE_WRITE ); … … 162 156 unsigned int save_sr; 163 157 164 // activates BDV interrupt 158 // get the BDV lock and register it in calling task context 159 static_scheduler_t* psched = _get_sched(); 160 unsigned int ltid = psched->current; 161 _spin_lock_acquire( &_bdv_lock ); 162 _atomic_or( &psched->context[ltid].slot[CTX_LOCKS_ID] , LOCKS_MASK_BDV ); 163 164 // set device registers 165 _bdv_set_register( BLOCK_DEVICE_BUFFER , (unsigned int)buf_paddr ); 166 _bdv_set_register( BLOCK_DEVICE_BUFFER_EXT, (unsigned int)(buf_paddr>>32) ); 167 _bdv_set_register( BLOCK_DEVICE_COUNT , count ); 168 _bdv_set_register( BLOCK_DEVICE_LBA , lba ); 165 169 _bdv_set_register( BLOCK_DEVICE_IRQ_ENABLE, 1 ); 166 170 … … 172 176 173 177 // Set NORUN_MASK_IOC bit 174 static_scheduler_t* psched = (static_scheduler_t*)_get_sched();175 unsigned int ltid = psched->current;176 178 _atomic_or( &psched->context[ltid].slot[CTX_NORUN_ID] , NORUN_MASK_IOC ); 177 179 … … 202 204 error = ( (_bdv_status == BLOCK_DEVICE_READ_ERROR) || 203 205 (_bdv_status == BLOCK_DEVICE_WRITE_ERROR) ); 204 } 205 206 // release BDV lock and clear task context207 _spin_lock_release( &_bdv_lock );208 _atomic_and( &psched->context[ltid].slot[CTX_LOCKS_ID] , ~LOCKS_MASK_BDV );206 207 // release BDV lock and clear task context 208 _spin_lock_release( &_bdv_lock ); 209 _atomic_and( &psched->context[ltid].slot[CTX_LOCKS_ID] , ~LOCKS_MASK_BDV ); 210 } 209 211 210 212 #if GIET_DEBUG_IOC
Note: See TracChangeset
for help on using the changeset viewer.