Changeset 446 for trunk/kernel/syscalls/sys_read.c
- Timestamp:
- Jun 19, 2018, 5:12:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_read.c
r443 r446 63 63 reg_t save_sr; // required to enable IRQs during syscall 64 64 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; 67 68 68 69 #if DEBUG_SYS_READ … … 165 166 count ); 166 167 } 167 else if( type == INODE_TYPE_DEV ) // check ownership & read from fromdevice168 else if( type == INODE_TYPE_DEV ) // check ownership & read from device 168 169 { 169 170 // get cluster and pointers on TXT_RX chdev … … 172 173 chdev_t * chdev_ptr = GET_PTR( chdev_xp ); 173 174 174 volatile xptr_t owner_xp; 175 volatile xptr_t txt_owner_xp; 176 uint32_t iter = 0; 175 177 176 178 while( 1 ) 177 179 { 178 // extended pointer on owner process179 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 ) ); 180 182 181 183 // check TXT_RX ownership 182 if ( XPTR( local_cxy , process ) !=owner_xp )184 if ( process_owner_xp != txt_owner_xp ) 183 185 { 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 184 190 // deschedule without blocking 185 sched_yield( "wait TXT ownership" ); 191 sched_yield( "wait TXT_RX ownership" ); 192 193 iter++; 186 194 } 187 195 else … … 191 199 } 192 200 201 printk("\n###### in %s : thread %x in process %x got TXT_RX ownership\n", 202 __FUNCTION__, this->trdid, process->pid ); 203 193 204 // move count bytes from device 194 205 nbytes = devfs_user_move( true, // from device to buffer
Note: See TracChangeset
for help on using the changeset viewer.