Changeset 450 for trunk/kernel/kern/chdev.c
- Timestamp:
- Jun 29, 2018, 10:44:14 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r447 r450 163 163 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 164 164 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 165 printk("\n[DBG] %s : client_thread %x (%s) enter for RX / cycle %d\n",166 __FUNCTION__, this, thread_type_str(this->type) , rx_cycle );165 printk("\n[DBG] %s : client_thread %x (%s) enter for RX / server = %x / cycle %d\n", 166 __FUNCTION__, this, thread_type_str(this->type) , server_ptr, rx_cycle ); 167 167 #endif 168 168 … … 170 170 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 171 171 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 172 printk("\n[DBG] %s : client_thread %x (%s) enter for TX / cycle %d\n",173 __FUNCTION__, this, thread_type_str(this->type) , tx_cycle );172 printk("\n[DBG] %s : client_thread %x (%s) enter for TX / server = %x / cycle %d\n", 173 __FUNCTION__, this, thread_type_str(this->type) , server_ptr, tx_cycle ); 174 174 #endif 175 175 … … 186 186 lock_xp = XPTR( chdev_cxy , &chdev_ptr->wait_lock ); 187 187 188 // critical section for the following sequence: 188 // critical section for the following sequence: 189 189 // (1) take the lock protecting waiting queue 190 190 // (2) block the client thread … … 205 205 thread_block( XPTR( local_cxy , CURRENT_THREAD ) , THREAD_BLOCKED_IO ); 206 206 207 #if (DEBUG_CHDEV_CMD_TX & 1) 208 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 209 printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this ); 210 #endif 211 207 212 // unblock server thread if required 208 213 if( hal_remote_lw( blocked_xp ) & THREAD_BLOCKED_IDLE ) 209 214 thread_unblock( server_xp , THREAD_BLOCKED_IDLE ); 210 215 216 #if (DEBUG_CHDEV_CMD_TX & 1) 217 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 218 { 219 printk("\n[DBG] in %s : server thread %x unblocked\n", __FUNCTION__, server_ptr ); 220 chdev_queue_display( chdev_xp ); 221 } 222 #endif 223 211 224 // register client thread in waiting queue 212 225 xlist_add_last( root_xp , list_xp ); 213 226 227 #if (DEBUG_CHDEV_CMD_TX & 1) 228 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 229 { 230 printk("\n[DBG] in %s : thread %x registered write request in chdev\n", __FUNCTION__, this ); 231 chdev_queue_display( chdev_xp ); 232 } 233 #endif 234 214 235 // send IPI to core running the server thread when server != client 215 236 different = (lid != this->core->lid) || (local_cxy != chdev_cxy); 216 if( different ) dev_pic_send_ipi( chdev_cxy , lid ); 237 if( different ) 238 { 239 dev_pic_send_ipi( chdev_cxy , lid ); 217 240 241 #if (DEBUG_CHDEV_CMD_TX & 1) 242 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 243 printk("\n[DBG] in %s : client thread %x sent IPI to server thread %x\n", 244 __FUNCTION__, this, server_ptr ); 245 #endif 246 247 } 248 218 249 // release lock 219 250 remote_spinlock_unlock( lock_xp ); … … 492 523 493 524 // get extended pointer on root of requests queue 494 root_xp = hal_remote_lwd( XPTR( chdev_cxy , &chdev_ptr->wait_root ));525 root_xp = XPTR( chdev_cxy , &chdev_ptr->wait_root ); 495 526 496 527 // get chdev name … … 516 547 pid = hal_remote_lw ( XPTR( thread_cxy , &process->pid ) ); 517 548 518 printk("- trdid %X / pid %X\n", trdid, pid ); 549 printk("- thread %X / cluster %X / trdid %X / pid %X\n", 550 thread_ptr, thread_cxy, trdid, pid ); 519 551 } 520 552 }
Note: See TracChangeset
for help on using the changeset viewer.