Changeset 457 for trunk/kernel/kern/chdev.c
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r450 r457 23 23 24 24 #include <kernel_config.h> 25 #include <hal_ types.h>25 #include <hal_kernel_types.h> 26 26 #include <hal_special.h> 27 27 #include <hal_remote.h> … … 127 127 xptr_t server_xp; // extended pointer on server thread 128 128 core_t * core_ptr; // local pointer on core running the server thread 129 uint32_t lid;// core running the server thread local index129 uint32_t server_lid; // core running the server thread local index 130 130 xptr_t lock_xp; // extended pointer on lock protecting the chdev queue 131 uint32_t different; // non zero if server thread core != client thread core132 131 uint32_t save_sr; // for critical section 133 132 … … 154 153 155 154 // get server core local index 156 lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) );155 server_lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) ); 157 156 158 157 #if (DEBUG_CHDEV_CMD_RX || DEBUG_CHDEV_CMD_TX) … … 210 209 #endif 211 210 211 #if (DEBUG_CHDEV_CMD_RX & 1) 212 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 213 printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this ); 214 #endif 215 212 216 // unblock server thread if required 213 217 if( hal_remote_lw( blocked_xp ) & THREAD_BLOCKED_IDLE ) … … 216 220 #if (DEBUG_CHDEV_CMD_TX & 1) 217 221 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 printk("\n[DBG] in %s : TX server thread %x unblocked\n", __FUNCTION__, server_ptr ); 223 #endif 224 225 #if (DEBUG_CHDEV_CMD_RX & 1) 226 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 227 printk("\n[DBG] in %s : RX server thread %x unblocked\n", __FUNCTION__, server_ptr ); 222 228 #endif 223 229 … … 227 233 #if (DEBUG_CHDEV_CMD_TX & 1) 228 234 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 229 {230 235 printk("\n[DBG] in %s : thread %x registered write request in chdev\n", __FUNCTION__, this ); 231 chdev_queue_display( chdev_xp ); 232 } 236 #endif 237 238 #if (DEBUG_CHDEV_CMD_RX & 1) 239 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 240 printk("\n[DBG] in %s : thread %x registered read request in chdev\n", __FUNCTION__, this ); 233 241 #endif 234 242 235 243 // send IPI to core running the server thread when server != client 236 different = (lid != this->core->lid) || (local_cxy != chdev_cxy); 237 if( different ) 238 { 239 dev_pic_send_ipi( chdev_cxy , lid ); 240 244 if( (server_lid != this->core->lid) || (local_cxy != chdev_cxy) ) 245 { 246 dev_pic_send_ipi( chdev_cxy , server_lid ); 247 241 248 #if (DEBUG_CHDEV_CMD_TX & 1) 242 249 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", 250 printk("\n[DBG] in %s : client thread %x sent IPI to TX server thread %x\n", 251 __FUNCTION__, this, server_ptr ); 252 #endif 253 254 #if (DEBUG_CHDEV_CMD_RX & 1) 255 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 256 printk("\n[DBG] in %s : client thread %x sent IPI to RX server thread %x\n", 244 257 __FUNCTION__, this, server_ptr ); 245 258 #endif
Note: See TracChangeset
for help on using the changeset viewer.