Changeset 568 for trunk/kernel/fs/devfs.c
- Timestamp:
- Oct 5, 2018, 12:02:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/devfs.c
r494 r568 52 52 #endif 53 53 54 /////////////////////////////// 54 ///////////////////////////////////// 55 55 devfs_ctx_t * devfs_ctx_alloc( void ) 56 56 { … … 91 91 { 92 92 error_t error; 93 94 #if DEBUG_DEVFS_INIT95 uint32_t cycle = (uint32_t)hal_get_cycles();96 if( DEBUG_DEVFS_INIT < cycle )97 printk("\n[DBG] %s : thread %x enter at cycle %d\n",98 __FUNCTION__ , CURRENT_THREAD , cycle );99 #endif100 93 101 94 // creates DEVFS "dev" inode in cluster 0 … … 110 103 assert( (error == 0) , "cannot create <dev>\n" ); 111 104 112 #if( DEBUG_DEVFS_INIT & 1 ) 113 if( DEBUG_DEVFS_INIT < cycle ) 114 printk("\n[DBG] %s : created <dev> inode at cycle %d\n", __FUNCTION__, cycle ); 105 #if DEBUG_DEVFS_INIT 106 uint32_t cycle = (uint32_t)hal_get_cycles(); 107 if( DEBUG_DEVFS_INIT < cycle ) 108 printk("\n[DBG] %s : thread %x in process %x created <dev> inode / cycle %d\n", 109 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid ,cycle ); 115 110 #endif 116 111 … … 129 124 cycle = (uint32_t)hal_get_cycles(); 130 125 if( DEBUG_DEVFS_INIT < cycle ) 131 printk("\n[DBG] %s : thread %x exit atcycle %d\n",132 __FUNCTION__ , CURRENT_THREAD, cycle );126 printk("\n[DBG] %s : thread %x in process %x created <external> inode / cycle %d\n", 127 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid , cycle ); 133 128 #endif 134 129 … … 147 142 uint32_t channel; 148 143 149 #if DEBUG_DEVFS_INIT 150 uint32_t cycle = (uint32_t)hal_get_cycles(); 151 if( DEBUG_DEVFS_INIT < cycle ) 152 printk("\n[DBG] %s : thread %x enter at cycle %d\n", 153 __FUNCTION__ , CURRENT_THREAD , cycle ); 154 #endif 155 156 // create "internal" directory linked to "dev" 144 // create "internal" directory 157 145 snprintf( node_name , 16 , "internal_%x" , local_cxy ); 158 146 vfs_add_child_in_parent( local_cxy, … … 163 151 NULL, 164 152 devfs_internal_inode_xp ); 153 #if DEBUG_DEVFS_INIT 154 uint32_t cycle = (uint32_t)hal_get_cycles(); 155 trdid_t trdid = CURRENT_THREAD->trdid; 156 pid_t pid = CURRENT_THREAD->process->pid; 157 if( DEBUG_DEVFS_INIT < cycle ) 158 printk("\n[DBG] %s : thread %x in process %x created <%s> in cluster %x / cycle %d\n", 159 __FUNCTION__, trdid, pid, node_name, local_cxy, cycle ); 160 #endif 165 161 166 162 // create MMC chdev inode … … 176 172 GET_PTR( chdev_xp ), 177 173 &inode_xp ); 174 #if DEBUG_DEVFS_INIT 175 cycle = (uint32_t)hal_get_cycles(); 176 if( DEBUG_DEVFS_INIT < cycle ) 177 printk("\n[DBG] %s : thread %x in process %x created <mmc> inode in cluster %x\n", 178 __FUNCTION__, trdid, pid, local_cxy, cycle ); 179 #endif 180 178 181 } 179 182 … … 192 195 GET_PTR( chdev_xp ), 193 196 &inode_xp ); 197 #if DEBUG_DEVFS_INIT 198 cycle = (uint32_t)hal_get_cycles(); 199 if( DEBUG_DEVFS_INIT < cycle ) 200 printk("\n[DBG] %s : thread %x in process %x created <dma[%d]> inode in cluster %x\n", 201 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 202 #endif 194 203 } 195 204 } … … 210 219 GET_PTR( chdev_xp ), 211 220 &inode_xp ); 221 #if DEBUG_DEVFS_INIT 222 cycle = (uint32_t)hal_get_cycles(); 223 if( DEBUG_DEVFS_INIT < cycle ) 224 printk("\n[DBG] %s : thread %x in process %x created <iob> inode in cluster %x\n", 225 __FUNCTION__, trdid, pid, local_cxy, cycle ); 226 #endif 212 227 } 213 228 } … … 228 243 GET_PTR( chdev_xp ), 229 244 &inode_xp ); 245 #if DEBUG_DEVFS_INIT 246 cycle = (uint32_t)hal_get_cycles(); 247 if( DEBUG_DEVFS_INIT < cycle ) 248 printk("\n[DBG] %s : thread %x in process %x created <pic> inode in cluster %x\n", 249 __FUNCTION__, trdid, pid, local_cxy, cycle ); 250 #endif 230 251 } 231 252 } … … 248 269 GET_PTR( chdev_xp ), 249 270 &inode_xp ); 271 #if DEBUG_DEVFS_INIT 272 cycle = (uint32_t)hal_get_cycles(); 273 if( DEBUG_DEVFS_INIT < cycle ) 274 printk("\n[DBG] %s : thread %x in process %x created <txt_rx[%d]> inode in cluster %x\n", 275 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 276 #endif 250 277 } 251 278 } … … 269 296 GET_PTR( chdev_xp ), 270 297 &inode_xp ); 298 #if DEBUG_DEVFS_INIT 299 cycle = (uint32_t)hal_get_cycles(); 300 if( DEBUG_DEVFS_INIT < cycle ) 301 printk("\n[DBG] %s : thread %x in process %x created <txt_tx[%d]> inode in cluster %x\n", 302 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 303 #endif 271 304 } 272 305 } … … 290 323 GET_PTR( chdev_xp ), 291 324 &inode_xp ); 325 #if DEBUG_DEVFS_INIT 326 cycle = (uint32_t)hal_get_cycles(); 327 if( DEBUG_DEVFS_INIT < cycle ) 328 printk("\n[DBG] %s : thread %x in process %x created <ioc[%d]> inode in cluster %x\n", 329 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 330 #endif 292 331 } 293 332 } … … 295 334 296 335 // create a FBF inode in each cluster containing a FBF chdev 297 for( channel = 0 ; channel < CONFIG_MAX_ IOC_CHANNELS ; channel++ )336 for( channel = 0 ; channel < CONFIG_MAX_FBF_CHANNELS ; channel++ ) 298 337 { 299 338 chdev_xp = chdev_dir.fbf[channel]; … … 311 350 GET_PTR( chdev_xp ), 312 351 &inode_xp ); 352 #if DEBUG_DEVFS_INIT 353 cycle = (uint32_t)hal_get_cycles(); 354 if( DEBUG_DEVFS_INIT < cycle ) 355 printk("\n[DBG] %s : thread %x in process %x created <fbf[%d]> inode in cluster %x\n", 356 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 357 #endif 313 358 } 314 359 } … … 332 377 GET_PTR( chdev_xp ), 333 378 &inode_xp ); 379 #if DEBUG_DEVFS_INIT 380 cycle = (uint32_t)hal_get_cycles(); 381 if( DEBUG_DEVFS_INIT < cycle ) 382 printk("\n[DBG] %s : thread %x in process %x created <nic_rx[%d]> inode in cluster %x\n", 383 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 384 #endif 334 385 } 335 386 } … … 353 404 GET_PTR( chdev_xp ), 354 405 &inode_xp ); 355 } 356 } 357 } 358 359 #if DEBUG_DEVFS_INIT 360 cycle = (uint32_t)hal_get_cycles(); 361 if( DEBUG_DEVFS_INIT < cycle ) 362 printk("\n[DBG] %s : thread %x exit at cycle %d\n", 363 __FUNCTION__ , CURRENT_THREAD , cycle ); 364 #endif 365 406 #if DEBUG_DEVFS_INIT 407 cycle = (uint32_t)hal_get_cycles(); 408 if( DEBUG_DEVFS_INIT < cycle ) 409 printk("\n[DBG] %s : thread %x in process %x created <nic_tx[%d]> inode in cluster %x\n", 410 __FUNCTION__, trdid, pid, channel, local_cxy, cycle ); 411 #endif 412 } 413 } 414 } 366 415 } // end devfs_local_init() 367 416 … … 408 457 409 458 // get chdev functionnal type and channel 410 func = hal_remote_l w( XPTR( chdev_cxy , &chdev_ptr->func ) );411 channel = hal_remote_l w( XPTR( chdev_cxy , &chdev_ptr->channel ) );459 func = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->func ) ); 460 channel = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) ); 412 461 413 462 // action depends on "func" and "to_buffer"
Note: See TracChangeset
for help on using the changeset viewer.