Changeset 433 for trunk/kernel/fs/devfs.c
- Timestamp:
- Feb 14, 2018, 3:40:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/devfs.c
r430 r433 28 28 #include <printk.h> 29 29 #include <chdev.h> 30 #include <thread.h> 30 31 #include <dev_txt.h> 31 32 #include <cluster.h> … … 86 87 error_t error; 87 88 88 devfs_dmsg("\n[DBG] %s : enter in cluster %x\n", 89 __FUNCTION__ , local_cxy ); 89 #if CONFIG_DEBUG_DEVFS_INIT 90 uint32_t cycle = (uint32_t)hal_get_cycles(); 91 if( CONFIG_DEBUG_DEVFS_INIT < cycle ) 92 printk("\n[DBG] %s : thread %x enter at cycle %d\n", 93 __FUNCTION__ , CURRENT_THREAD , cycle ); 94 #endif 90 95 91 96 // creates DEVFS "dev" inode in cluster IO … … 100 105 assert( (error == 0) , __FUNCTION__ , "cannot create <dev>\n" ); 101 106 102 devfs_dmsg("\n[DBG] %s : <dev> created in cluster %x\n",103 __FUNCTION__ , local_cxy );104 105 107 // create DEVFS "external" inode in cluster IO 106 108 error = vfs_add_child_in_parent( LOCAL_CLUSTER->io_cxy, … … 114 116 assert( (error == 0) , __FUNCTION__ , "cannot create <external>\n" ); 115 117 116 devfs_dmsg("\n[DBG] %s : <external> created in cluster %x\n", 117 __FUNCTION__ , local_cxy ); 118 #if CONFIG_DEBUG_DEVFS_INIT 119 cycle = (uint32_t)hal_get_cycles(); 120 if( CONFIG_DEBUG_DEVFS_INIT < cycle ) 121 printk("\n[DBG] %s : thread %x exit at cycle %d\n", 122 __FUNCTION__ , CURRENT_THREAD , cycle ); 123 #endif 124 118 125 } 119 126 … … 129 136 xptr_t inode_xp; 130 137 uint32_t channel; 138 139 #if CONFIG_DEBUG_DEVFS_INIT 140 uint32_t cycle = (uint32_t)hal_get_cycles(); 141 if( CONFIG_DEBUG_DEVFS_INIT < cycle ) 142 printk("\n[DBG] %s : thread %x enter at cycle %d\n", 143 __FUNCTION__ , CURRENT_THREAD , cycle ); 144 #endif 131 145 132 146 // create "internal" directory linked to "dev" … … 140 154 devfs_internal_inode_xp ); 141 155 142 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",143 __FUNCTION__ , node_name , local_cxy );144 145 156 // create MMC chdev inode 146 157 chdev_xp = chdev_dir.mmc[local_cxy]; … … 155 166 GET_PTR( chdev_xp ), 156 167 &inode_xp ); 157 158 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",159 __FUNCTION__ , chdev_ptr->name , local_cxy );160 161 168 } 162 169 … … 175 182 GET_PTR( chdev_xp ), 176 183 &inode_xp ); 177 178 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",179 __FUNCTION__ , chdev_ptr->name , local_cxy );180 181 184 } 182 185 } … … 197 200 GET_PTR( chdev_xp ), 198 201 &inode_xp ); 199 200 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",201 __FUNCTION__ , chdev_ptr->name , local_cxy );202 203 202 } 204 203 } … … 219 218 GET_PTR( chdev_xp ), 220 219 &inode_xp ); 221 222 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",223 __FUNCTION__ , chdev_ptr->name , local_cxy );224 225 220 } 226 221 } … … 243 238 GET_PTR( chdev_xp ), 244 239 &inode_xp ); 245 246 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",247 __FUNCTION__ , chdev_ptr->name , local_cxy );248 249 240 } 250 241 } … … 268 259 GET_PTR( chdev_xp ), 269 260 &inode_xp ); 270 271 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",272 __FUNCTION__ , chdev_ptr->name , local_cxy );273 274 261 } 275 262 } … … 293 280 GET_PTR( chdev_xp ), 294 281 &inode_xp ); 295 296 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",297 __FUNCTION__ , chdev_ptr->name , local_cxy );298 299 282 } 300 283 } … … 318 301 GET_PTR( chdev_xp ), 319 302 &inode_xp ); 320 321 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",322 __FUNCTION__ , chdev_ptr->name , local_cxy );323 324 303 } 325 304 } … … 343 322 GET_PTR( chdev_xp ), 344 323 &inode_xp ); 345 346 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",347 __FUNCTION__ , chdev_ptr->name , local_cxy );348 349 324 } 350 325 } … … 368 343 GET_PTR( chdev_xp ), 369 344 &inode_xp ); 370 371 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n", 372 __FUNCTION__ , chdev_ptr->name , local_cxy ); 373 374 } 375 } 376 } 345 } 346 } 347 } 348 349 #if CONFIG_DEBUG_DEVFS_INIT 350 cycle = (uint32_t)hal_get_cycles(); 351 if( CONFIG_DEBUG_DEVFS_INIT < cycle ) 352 printk("\n[DBG] %s : thread %x exit at cycle %d\n", 353 __FUNCTION__ , CURRENT_THREAD , cycle ); 354 #endif 355 377 356 } // end devfs_local_init() 378 357 … … 396 375 char k_buf[CONFIG_TXT_KBUF_SIZE]; // local kernel buffer 397 376 398 devfs_dmsg("\n[DBG] %s enter / cycle %d\n", 399 __FUNCTION__ , hal_time_stamp() ); 377 #if CONFIG_DEBUG_DEVFS_MOVE 378 uint32_t cycle = (uint32_t)hal_get_cycles(); 379 if( CONFIG_DEBUG_DEVFS_MOVE < cycle ) 380 printk("\n[DBG] %s : thread %x enter / to_mem %d / cycle %d\n", 381 __FUNCTION__ , CURRENT_THREAD , to_buffer , cycle ); 382 #endif 400 383 401 384 #if CONFIG_READ_DEBUG … … 426 409 if( error ) 427 410 { 428 429 devfs_dmsg("\n[DBG] %s exit error / cycle %d\n",430 __FUNCTION__ , hal_time_stamp() );431 432 411 return -1; 433 412 } … … 438 417 } 439 418 419 #if CONFIG_DEBUG_DEVFS_MOVE 420 cycle = (uint32_t)hal_get_cycles(); 421 if( CONFIG_DEBUG_DEVFS_MOVE < cycle ) 422 printk("\n[DBG] %s : thread %x exit / to_mem %d / cycle %d\n", 423 __FUNCTION__ , CURRENT_THREAD , to_buffer / cycle ); 424 #endif 425 440 426 #if CONFIG_READ_DEBUG 441 427 exit_devfs_move = hal_time_stamp(); 442 428 #endif 443 444 devfs_dmsg("\n[DBG] %s exit success / size = %d / cycle %d\n",445 __FUNCTION__ , size , hal_time_stamp() );446 447 429 return size; 448 430 } … … 454 436 if( error ) 455 437 { 456 457 devfs_dmsg("\n[DBG] %s exit error / cycle %d\n",458 __FUNCTION__ , hal_time_stamp() );459 460 438 return -1; 461 439 } … … 463 441 { 464 442 465 devfs_dmsg("\n[DBG] %s exit success / size = %d / cycle %d\n", 466 __FUNCTION__ , size , hal_time_stamp() ); 443 #if CONFIG_DEBUG_DEVFS_MOVE 444 cycle = (uint32_t)hal_get_cycles(); 445 if( CONFIG_DEBUG_DEVFS_MOVE < cycle ) 446 printk("\n[DBG] %s : thread %x exit / to_mem %d / cycle %d\n", 447 __FUNCTION__ , CURRENT_THREAD , to_buffer / cycle ); 448 #endif 467 449 468 450 return size; … … 477 459 return -1; 478 460 } 461 479 462 } // end devfs_user_move() 480 463
Note: See TracChangeset
for help on using the changeset viewer.