Changeset 435 for trunk/kernel/kern/chdev.c
- Timestamp:
- Feb 20, 2018, 5:32:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r433 r435 39 39 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 40 40 41 #if CONFIG_READ_DEBUG 42 extern uint32_t enter_chdev_cmd; 43 extern uint32_t exit_chdev_cmd; 44 extern uint32_t enter_chdev_server; 45 extern uint32_t exit_chdev_server; 41 #if (CONFIG_DEBUG_SYS_READ & 1) 42 extern uint32_t enter_chdev_cmd_read; 43 extern uint32_t exit_chdev_cmd_read; 44 extern uint32_t enter_chdev_server_read; 45 extern uint32_t exit_chdev_server_read; 46 #endif 47 48 #if (CONFIG_DEBUG_SYS_WRITE & 1) 49 extern uint32_t enter_chdev_cmd_write; 50 extern uint32_t exit_chdev_cmd_write; 51 extern uint32_t enter_chdev_server_write; 52 extern uint32_t exit_chdev_server_write; 46 53 #endif 47 54 … … 123 130 uint32_t save_sr; // for critical section 124 131 125 #if CONFIG_READ_DEBUG 126 enter_chdev_cmd = hal_time_stamp(); 132 #if (CONFIG_DEBUG_SYS_READ & 1) 133 enter_chdev_cmd_read = (uint32_t)hal_get_cycles(); 134 #endif 135 136 #if (CONFIG_DEBUG_SYS_WRITE & 1) 137 enter_chdev_cmd_write = (uint32_t)hal_get_cycles(); 127 138 #endif 128 139 … … 178 189 if( different ) dev_pic_send_ipi( chdev_cxy , lid ); 179 190 191 // deschedule 192 assert( thread_can_yield( this ) , __FUNCTION__ , "illegal sched_yield\n" ); 193 sched_yield("blocked on I/O"); 194 195 // exit critical section 196 hal_restore_irq( save_sr ); 197 180 198 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND 181 199 cycle = (uint32_t)hal_get_cycles(); … … 185 203 #endif 186 204 187 // deschedule 188 assert( thread_can_yield( this ) , __FUNCTION__ , "illegal sched_yield\n" ); 189 sched_yield("blocked on I/O"); 190 191 // exit critical section 192 hal_restore_irq( save_sr ); 193 194 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND 195 cycle = (uint32_t)hal_get_cycles(); 196 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle ) 197 printk("\n[DBG] %s : client_thread %x (%s) resumes / cycle %d\n", 198 __FUNCTION__, this, thread_type_str(this->type) , cycle ); 199 #endif 200 201 #if CONFIG_READ_DEBUG 202 exit_chdev_cmd = hal_time_stamp(); 205 #if (CONFIG_DEBUG_SYS_READ & 1) 206 exit_chdev_cmd_read = (uint32_t)hal_get_cycles(); 207 #endif 208 209 #if (CONFIG_DEBUG_SYS_WRITE & 1) 210 exit_chdev_cmd_write = (uint32_t)hal_get_cycles(); 203 211 #endif 204 212 … … 240 248 remote_spinlock_unlock( lock_xp ); 241 249 242 chdev_dmsg("\n[DBG] %s : thread %x deschedule /cycle %d\n",243 __FUNCTION__ , server , hal_time_stamp() );244 245 250 // deschedule 246 251 sched_yield("I/O queue empty"); 247 248 chdev_dmsg("\n[DBG] %s : thread %x resume /cycle %d\n",249 __FUNCTION__ , server , hal_time_stamp() );250 251 252 } 252 253 else // waiting queue not empty 253 254 { 254 255 255 #if CONFIG_READ_DEBUG 256 enter_chdev_server = hal_time_stamp(); 257 #endif 256 #if (CONFIG_DEBUG_SYS_READ & 1) 257 enter_chdev_server_read = (uint32_t)hal_get_cycles(); 258 #endif 259 260 #if (CONFIG_DEBUG_SYS_WRITE & 1) 261 enter_chdev_server_write = (uint32_t)hal_get_cycles(); 262 #endif 263 258 264 // release lock 259 265 remote_spinlock_unlock( lock_xp ); … … 284 290 #endif 285 291 286 #if CONFIG_READ_DEBUG 287 exit_chdev_server = hal_time_stamp(); 292 #if (CONFIG_DEBUG_SYS_READ & 1) 293 exit_chdev_server_read = (uint32_t)hal_get_cycles(); 294 #endif 295 296 #if (CONFIG_DEBUG_SYS_WRITE & 1) 297 exit_chdev_server_write = (uint32_t)hal_get_cycles(); 288 298 #endif 289 299
Note: See TracChangeset
for help on using the changeset viewer.