Changeset 626 for trunk/hal/tsar_mips32/drivers/soclib_bdv.c
- Timestamp:
- Apr 29, 2019, 7:25:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_bdv.c
r622 r626 58 58 void __attribute__ ((noinline)) soclib_bdv_cmd( xptr_t th_xp ) 59 59 { 60 uint32_t cmd_type; // IOC_READ / IOC_WRITE / IOC_SYNC_READ 60 uint32_t cmd_type; // IOC_READ / IOC_WRITE / IOC_SYNC_READ / IOC_SYNC_WRITE 61 61 uint32_t lba; 62 62 uint32_t count; … … 86 86 ioc_xp = (xptr_t)hal_remote_l64( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) ); 87 87 88 #if DEBUG_HAL_IOC_RX 89 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) ) 90 printk("\n[%s] thread[%x,%x] enters for client thread[%x,%x] / RX / cycle %d\n", 91 __FUNCTION__ , this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 92 #endif 93 94 #if DEBUG_HAL_IOC_TX 95 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) ) 96 printk("\n[%s] thread[%x,%x] enters for client thread[%x,%x] / TX / cycle %d\n", 97 __FUNCTION__ , this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 98 #endif 88 // decode command 89 if ( (cmd_type == IOC_READ) || (cmd_type == IOC_SYNC_READ) ) op = BDV_OP_READ; 90 else if( (cmd_type == IOC_WRITE) || (cmd_type == IOC_SYNC_WRITE) ) op = BDV_OP_WRITE; 91 else assert( false , "illegal command" ); 99 92 100 93 // get IOC device cluster and local pointer … … 110 103 uint32_t buf_lsb = (uint32_t)(buf_xp); 111 104 uint32_t buf_msb = (uint32_t)(buf_xp>>32); 105 106 #if DEBUG_HAL_IOC_RX 107 if( DEBUG_HAL_IOC_RX < cycle ) 108 printk("\n[%s] thread[%x,%x] enters / client[%x,%x] / cmd %d / lba %x / buf(%x,%x) / cycle %d\n", 109 __FUNCTION__ , this->process->pid, this->trdid, client_pid, client_trdid, 110 cmd_type, lba, buf_msb, buf_lsb, cycle ); 111 #endif 112 113 #if DEBUG_HAL_IOC_TX 114 if( DEBUG_HAL_IOC_TX < cycle ) 115 printk("\n[%s] thread[%x,%x] enters / client[%x,%x] / cmd %d / lba %x / buf(%x,%x) / cycle %d\n", 116 __FUNCTION__ , this->process->pid, this->trdid, client_pid, client_trdid, 117 cmd_type, lba, buf_msb, buf_lsb, cycle ); 118 #endif 112 119 113 120 // select operation … … 143 150 { 144 151 hal_remote_s32( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 0 ); 152 153 #if DEBUG_HAL_IOC_RX 154 cycle = (uint32_t)hal_get_cycles(); 155 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type == IOC_SYNC_READ) ) 156 printk("\n[%s] thread[%x,%x] exit after SYNC_READ for client thread[%x,%x] / cycle %d\n", 157 __FUNCTION__, this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 158 #endif 159 160 #if DEBUG_HAL_IOC_TX 161 cycle = (uint32_t)hal_get_cycles(); 162 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_SYNC_WRITE) ) 163 printk("\n[%s] thread[%x,%x] exit after SYNC_WRITE for client thread[%x,%x] / cycle %d\n", 164 __FUNCTION__, this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 165 #endif 145 166 break; 146 167 } 147 else if( status == BDV_BUSY ) // non completed168 else if( status == BDV_BUSY ) // non completed 148 169 { 149 170 continue; 150 171 } 151 else // error reported172 else // error reported 152 173 { 153 174 hal_remote_s32( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 1 ); … … 170 191 #if DEBUG_HAL_IOC_RX 171 192 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) ) 172 printk("\n[%s] thread[%x,%x] blocks & deschedules after lauching R Xtransfer\n",193 printk("\n[%s] thread[%x,%x] blocks & deschedules after lauching READ transfer\n", 173 194 __FUNCTION__ , this->process->pid, this->trdid ); 174 195 #endif … … 176 197 #if DEBUG_HAL_IOC_TX 177 198 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) ) 178 printk("\n[%s] thread[%x,%x] blocks & deschedules after lauching TXtransfer\n",199 printk("\n[%s] thread[%x,%x] blocks & deschedules after lauching WRITE transfer\n", 179 200 __FUNCTION__ , this->process->pid, this->trdid ); 180 201 #endif … … 184 205 // exit critical section 185 206 hal_restore_irq( save_sr ); 186 }187 207 188 208 #if DEBUG_HAL_IOC_RX 189 209 cycle = (uint32_t)hal_get_cycles(); 190 210 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE) ) 191 printk("\n[%s] thread[%x,%x] exit after R Xfor client thread[%x,%x] / cycle %d\n",211 printk("\n[%s] thread[%x,%x] exit after READ for client thread[%x,%x] / cycle %d\n", 192 212 __FUNCTION__, this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 193 213 #endif … … 196 216 cycle = (uint32_t)hal_get_cycles(); 197 217 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) ) 198 printk("\n[%s] thread[%x,%x] exit after TX for client thread[%x,%x] / cycle %d\n", 199 __FUNCTION__, this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 200 #endif 218 printk("\n[%s] thread[%x,%x] exit after WRITE for client thread[%x,%x] / cycle %d\n", 219 __FUNCTION__, this->process->pid, this->trdid, client_pid, client_trdid, cycle ); 220 #endif 221 222 } 201 223 202 224 } // end soclib_bdv_cmd() … … 263 285 else 264 286 { 265 assert( false , " IOC_SYNC_READ should not use IRQ");287 assert( false , "illegal command %d", cmd_type ); 266 288 } 267 289
Note: See TracChangeset
for help on using the changeset viewer.