Ignore:
Timestamp:
Jun 19, 2018, 5:12:57 PM (4 years ago)
Author:
alain
Message:

miscelaneous...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_read.c

    r443 r446  
    6363    reg_t        save_sr;     // required to enable IRQs during syscall
    6464
    65         thread_t  *  this    = CURRENT_THREAD;
    66         process_t *  process = this->process;
     65        thread_t  *  this             = CURRENT_THREAD;
     66        process_t *  process          = this->process;
     67    xptr_t       process_owner_xp = process->owner_xp;
    6768 
    6869#if DEBUG_SYS_READ
     
    165166                                count );
    166167    }
    167     else if( type == INODE_TYPE_DEV )  // check ownership & read from from device
     168    else if( type == INODE_TYPE_DEV )  // check ownership & read from device
    168169    {
    169170        // get cluster and pointers on TXT_RX chdev
     
    172173        chdev_t * chdev_ptr = GET_PTR( chdev_xp );
    173174
    174         volatile xptr_t    owner_xp;   
     175        volatile xptr_t    txt_owner_xp;   
     176        uint32_t           iter = 0;
    175177
    176178        while( 1 )
    177179        {
    178             // extended pointer on owner process
    179             owner_xp  = hal_remote_lwd( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) );
     180            // extended pointer on TXT owner process
     181            txt_owner_xp  = hal_remote_lwd( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) );
    180182
    181183            // check TXT_RX ownership
    182             if ( XPTR( local_cxy , process ) != owner_xp )
     184            if ( process_owner_xp != txt_owner_xp )
    183185            {
     186                if( (iter & 0xFFF) == 0 )
     187                printk("\n[WARNING] in %s : thread %x in process %x wait TXT_RX / cycle %d\n",
     188                __FUNCTION__, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
     189
    184190                // deschedule without blocking
    185                 sched_yield( "wait TXT ownership" );
     191                sched_yield( "wait TXT_RX ownership" );
     192
     193                iter++;
    186194            }
    187195            else
     
    191199        }
    192200
     201printk("\n###### in %s : thread %x in process %x got TXT_RX ownership\n",
     202__FUNCTION__, this->trdid, process->pid );
     203               
    193204        // move count bytes from device
    194205        nbytes = devfs_user_move( true,             // from device to buffer
Note: See TracChangeset for help on using the changeset viewer.