Changeset 437 for trunk/kernel/kern/chdev.c
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r436 r437 140 140 thread_t * this = CURRENT_THREAD; 141 141 142 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND143 uint32_t cycle = (uint32_t)hal_get_cycles();144 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle )145 printk("\n[DBG] %s : client_thread %x (%s) enter / cycle %d\n",146 __FUNCTION__, this, thread_type_str(this->type) , cycle );147 #endif148 149 142 // get device descriptor cluster and local pointer 150 143 cxy_t chdev_cxy = GET_CXY( chdev_xp ); 151 144 chdev_t * chdev_ptr = (chdev_t *)GET_PTR( chdev_xp ); 145 146 #if (CONFIG_DEBUG_CHDEV_CMD_RX || CONFIG_DEBUG_CHDEV_CMD_TX) 147 bool_t is_rx = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->is_rx ) ); 148 #endif 149 150 #if CONFIG_DEBUG_CHDEV_CMD_RX 151 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 152 if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) ) 153 printk("\n[DBG] %s : client_thread %x (%s) enter for RX / cycle %d\n", 154 __FUNCTION__, this, thread_type_str(this->type) , rx_cycle ); 155 #endif 156 157 #if CONFIG_DEBUG_CHDEV_CMD_TX 158 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 159 if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) ) 160 printk("\n[DBG] %s : client_thread %x (%s) enter for TX / cycle %d\n", 161 __FUNCTION__, this, thread_type_str(this->type) , tx_cycle ); 162 #endif 152 163 153 164 // build extended pointers on client thread xlist and device root … … 196 207 hal_restore_irq( save_sr ); 197 208 198 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND 199 cycle = (uint32_t)hal_get_cycles(); 200 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle ) 201 printk("\n[DBG] %s : client_thread %x (%s) exit / cycle %d\n", 202 __FUNCTION__, this, thread_type_str(this->type) , cycle ); 209 #if CONFIG_DEBUG_CHDEV_CMD_RX 210 rx_cycle = (uint32_t)hal_get_cycles(); 211 if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) ) 212 printk("\n[DBG] %s : client_thread %x (%s) exit for RX / cycle %d\n", 213 __FUNCTION__, this, thread_type_str(this->type) , rx_cycle ); 214 #endif 215 216 #if CONFIG_DEBUG_CHDEV_CMD_TX 217 tx_cycle = (uint32_t)hal_get_cycles(); 218 if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) ) 219 printk("\n[DBG] %s : client_thread %x (%s) exit for TX / cycle %d\n", 220 __FUNCTION__, this, thread_type_str(this->type) , tx_cycle ); 203 221 #endif 204 222 … … 225 243 server = CURRENT_THREAD; 226 244 227 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER 228 uint32_t cycle = (uint32_t)hal_get_cycles(); 229 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle ) 230 printk("\n[DBG] %s : server_thread %x enter / chdev = %x / cycle %d\n", 231 __FUNCTION__ , server , chdev , cycle ); 232 #endif 233 245 // get root and lock on command queue 234 246 root_xp = XPTR( local_cxy , &chdev->wait_root ); 235 247 lock_xp = XPTR( local_cxy , &chdev->wait_lock ); … … 253 265 else // waiting queue not empty 254 266 { 255 256 #if (CONFIG_DEBUG_SYS_READ & 1)257 enter_chdev_server_read = (uint32_t)hal_get_cycles();258 #endif259 260 #if (CONFIG_DEBUG_SYS_WRITE & 1)261 enter_chdev_server_write = (uint32_t)hal_get_cycles();262 #endif263 264 267 // release lock 265 268 remote_spinlock_unlock( lock_xp ); … … 271 274 client_cxy = GET_CXY( client_xp ); 272 275 client_ptr = (thread_t *)GET_PTR( client_xp ); 276 277 #if CONFIG_DEBUG_CHDEV_SERVER_RX 278 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 279 if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 280 printk("\n[DBG] %s : server_thread %x start RX / client %x / cycle %d\n", 281 __FUNCTION__ , server , client_ptr , rx_cycle ); 282 #endif 283 284 #if CONFIG_DEBUG_CHDEV_SERVER_TX 285 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 286 if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 287 printk("\n[DBG] %s : server_thread %x start TX / client %x / cycle %d\n", 288 __FUNCTION__ , server , client_ptr , tx_cycle ); 289 #endif 290 291 #if (CONFIG_DEBUG_SYS_READ & 1) 292 enter_chdev_server_read = (uint32_t)hal_get_cycles(); 293 #endif 294 295 #if (CONFIG_DEBUG_SYS_WRITE & 1) 296 enter_chdev_server_write = (uint32_t)hal_get_cycles(); 297 #endif 273 298 274 299 // call driver command function to execute I/O operation … … 283 308 thread_unblock( client_xp , THREAD_BLOCKED_IO ); 284 309 285 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER 286 cycle = (uint32_t)hal_get_cycles(); 287 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle ) 288 printk("\n[DBG] %s : server_thread %x complete operation for client %x / cycle %d\n", 289 __FUNCTION__ , server , client_ptr , cycle ); 310 #if CONFIG_DEBUG_CHDEV_SERVER_RX 311 rx_cycle = (uint32_t)hal_get_cycles(); 312 if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 313 printk("\n[DBG] %s : server_thread %x completes RX / client %x / cycle %d\n", 314 __FUNCTION__ , server , client_ptr , rx_cycle ); 315 #endif 316 317 #if CONFIG_DEBUG_CHDEV_SERVER_TX 318 tx_cycle = (uint32_t)hal_get_cycles(); 319 if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 320 printk("\n[DBG] %s : server_thread %x completes TX / client %x / cycle %d\n", 321 __FUNCTION__ , server , client_ptr , tx_cycle ); 290 322 #endif 291 323
Note: See TracChangeset
for help on using the changeset viewer.