Ignore:
Timestamp:
Jan 15, 2019, 1:59:32 PM (6 years ago)
Author:
alain
Message:

1) introduce a dev_ioc_sync_write() function in IOC API,

to improve the DEVFS synchronous update.

2) fix a big bug in both the user_dir_create() and user_dir_destroy()

functions: add an extended pointer on the reference client process
in the function's arguments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/fs/devfs.c

    r612 r614  
    110110assert( (error == 0) , "cannot create <dev>\n" );
    111111
    112 #if DEBUG_DEVFS_INIT
     112#if DEBUG_DEVFS_GLOBAL_INIT
    113113uint32_t   cycle = (uint32_t)hal_get_cycles();
    114114thread_t * this  = CURRENT_THREAD;
    115 if( DEBUG_DEVFS_INIT < cycle )
     115if( DEBUG_DEVFS_GLOBAL_INIT < cycle )
    116116printk("\n[%s] thread[%x,%x] created <dev> inode / cycle %d\n",
    117117__FUNCTION__, this->process->pid, this->trdid, cycle );
     
    134134assert( (error == 0) , "cannot create <external>\n" );
    135135
    136 #if DEBUG_DEVFS_INIT
    137 cycle = (uint32_t)hal_get_cycles();
    138 if( DEBUG_DEVFS_INIT < cycle )
     136#if DEBUG_DEVFS_GLOBAL_INIT
     137cycle = (uint32_t)hal_get_cycles();
     138if( DEBUG_DEVFS_GLOBAL_INIT < cycle )
    139139printk("\n[%s] thread[%x,%x] created <external> inode / cycle %d\n",
    140140__FUNCTION__, this->process->pid, this->trdid, cycle );
     
    159159    error_t       error;
    160160
     161#if DEBUG_DEVFS_LOCAL_INIT
     162uint32_t   cycle = (uint32_t)hal_get_cycles();
     163thread_t * this  = CURRENT_THREAD;
     164if( DEBUG_DEVFS_LOCAL_INIT < cycle )
     165printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
     166__FUNCTION__, this->process->pid, this->trdid, cycle );
     167#endif
     168
    161169    // create "internal" directory
    162170    snprintf( node_name , 16 , "internal_%x" , local_cxy );
     
    177185assert( (error == 0) , "cannot create <external>\n" );
    178186
    179 #if DEBUG_DEVFS_INIT
    180 uint32_t   cycle = (uint32_t)hal_get_cycles();
    181 thread_t * this  = CURRENT_THREAD;
    182 if( DEBUG_DEVFS_INIT < cycle )
     187#if DEBUG_DEVFS_LOCAL_INIT
     188cycle = (uint32_t)hal_get_cycles();
     189if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    183190printk("\n[%s] thread[%x,%x] created <%s> inode in cluster %x / cycle %d\n",
    184191__FUNCTION__, this->process->pid, this->trdid, node_name, local_cxy, cycle );
     
    209216        hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    210217       
    211 #if DEBUG_DEVFS_INIT
    212 cycle = (uint32_t)hal_get_cycles();
    213 if( DEBUG_DEVFS_INIT < cycle )
     218#if DEBUG_DEVFS_LOCAL_INIT
     219cycle = (uint32_t)hal_get_cycles();
     220if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    214221printk("\n[%s] thread[%x,%x] created <mmc> inode in cluster %x\n",
    215222__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
     
    244251            hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    245252       
    246 #if DEBUG_DEVFS_INIT
    247 cycle = (uint32_t)hal_get_cycles();
    248 if( DEBUG_DEVFS_INIT < cycle )
     253#if DEBUG_DEVFS_LOCAL_INIT
     254cycle = (uint32_t)hal_get_cycles();
     255if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    249256printk("\n[%s] thread [%x,%x] created <dma[%d]> inode in cluster %x\n",
    250257__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    277284            hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    278285       
    279 #if DEBUG_DEVFS_INIT
    280 cycle = (uint32_t)hal_get_cycles();
    281 if( DEBUG_DEVFS_INIT < cycle )
     286#if DEBUG_DEVFS_LOCAL_INIT
     287cycle = (uint32_t)hal_get_cycles();
     288if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    282289printk("\n[%s] thread[%x,%x] created <iob> inode in cluster %x\n",
    283290__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
     
    310317            hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    311318       
    312 #if DEBUG_DEVFS_INIT
    313 cycle = (uint32_t)hal_get_cycles();
    314 if( DEBUG_DEVFS_INIT < cycle )
     319#if DEBUG_DEVFS_LOCAL_INIT
     320cycle = (uint32_t)hal_get_cycles();
     321if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    315322printk("\n[%s] thread[%x,%x] created <pic> inode in cluster %x\n",
    316323__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
     
    345352                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    346353       
    347 #if DEBUG_DEVFS_INIT
    348 cycle = (uint32_t)hal_get_cycles();
    349 if( DEBUG_DEVFS_INIT < cycle )
     354#if DEBUG_DEVFS_LOCAL_INIT
     355cycle = (uint32_t)hal_get_cycles();
     356if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    350357printk("\n[%s] thread[%x,%x] created <txt_rx[%d]> inode in cluster %x\n",
    351358__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    381388                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    382389       
    383 #if DEBUG_DEVFS_INIT
    384 cycle = (uint32_t)hal_get_cycles();
    385 if( DEBUG_DEVFS_INIT < cycle )
     390#if DEBUG_DEVFS_LOCAL_INIT
     391cycle = (uint32_t)hal_get_cycles();
     392if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    386393printk("\n[%s] thread[%x,%x] created <txt_tx[%d]> inode in cluster %x\n",
    387394__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    417424                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    418425       
    419 #if DEBUG_DEVFS_INIT
    420 cycle = (uint32_t)hal_get_cycles();
    421 if( DEBUG_DEVFS_INIT < cycle )
     426#if DEBUG_DEVFS_LOCAL_INIT
     427cycle = (uint32_t)hal_get_cycles();
     428if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    422429printk("\n[%s] thread[%x,%x] created <ioc[%d]> inode in cluster %x\n",
    423430__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    453460                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    454461       
    455 #if DEBUG_DEVFS_INIT
    456 cycle = (uint32_t)hal_get_cycles();
    457 if( DEBUG_DEVFS_INIT < cycle )
     462#if DEBUG_DEVFS_LOCAL_INIT
     463cycle = (uint32_t)hal_get_cycles();
     464if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    458465printk("\n[%s] thread[%x,%x] created <fbf[%d]> inode in cluster %x\n",
    459466__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    489496                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    490497 
    491 #if DEBUG_DEVFS_INIT
    492 cycle = (uint32_t)hal_get_cycles();
    493 if( DEBUG_DEVFS_INIT < cycle )
     498#if DEBUG_DEVFS_LOCAL_INIT
     499cycle = (uint32_t)hal_get_cycles();
     500if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    494501printk("\n[%s] thread[%x,%x] created <nic_rx[%d]> inode in cluster %x\n",
    495502__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
     
    525532                hal_remote_spt( XPTR( inode_cxy , &inode_ptr->extend ) , chdev_ptr );
    526533       
    527 #if DEBUG_DEVFS_INIT
    528 cycle = (uint32_t)hal_get_cycles();
    529 if( DEBUG_DEVFS_INIT < cycle )
     534#if DEBUG_DEVFS_LOCAL_INIT
     535cycle = (uint32_t)hal_get_cycles();
     536if( DEBUG_DEVFS_LOCAL_INIT < cycle )
    530537printk("\n[%s] thread[%x,%x] created <nic_tx[%d]> inode in cluster %x\n",
    531538__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
Note: See TracChangeset for help on using the changeset viewer.