Changeset 566 for trunk/kernel/syscalls/sys_condvar.c
- Timestamp:
- Oct 4, 2018, 11:50:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_condvar.c
r508 r566 32 32 #include <remote_mutex.h> 33 33 34 //////////////////////////////////////// 34 35 #if DEBUG_SYS_CONDVAR 36 ///////////////////////////////////////////////////// 37 static char * sys_convar_op_str( uint32_t operation ) 38 { 39 if ( operation == CONDVAR_INIT ) return "INIT"; 40 else if( operation == CONDVAR_WAIT ) return "WAIT"; 41 else if( operation == CONDVAR_SIGNAL ) return "SIGNAL"; 42 else if( operation == CONDVAR_BROADCAST ) return "BROADCAST"; 43 else if( operation == CONDVAR_DESTROY ) return "DESTROY"; 44 else return "undefined"; 45 } 46 #endif 47 48 ////////////////////////////////////// 35 49 int sys_condvar( void * condvar, 36 50 uint32_t operation, 37 51 void * mutex ) 38 52 { 53 vseg_t * vseg; // for condvar check 39 54 error_t error; 40 vseg_t * vseg;41 55 42 56 thread_t * this = CURRENT_THREAD; 43 57 process_t * process = this->process; 58 59 #if DEBUG_SYS_CONDVAR 60 uint64_t tm_start; 61 uint64_t tm_end; 62 tm_start = hal_get_cycles(); 63 if( DEBUG_SYS_CONDVAR < tm_start ) 64 printk("\n[DBG] %s : thread %x in process %x enter for %s / cycle %d\n", 65 __FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start ); 66 #endif 44 67 45 68 // check condvar in user vspace … … 191 214 } // end switch 192 215 216 hal_fence(); 217 218 #if DEBUG_SYS_CONDVAR 219 tm_start = hal_get_cycles(); 220 if( DEBUG_SYS_MUTEX < tm_start ) 221 printk("\n[DBG] %s : thread %x in process %x exit for %s / cycle %d\n", 222 __FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start ); 223 #endif 224 193 225 return 0; 194 226
Note: See TracChangeset
for help on using the changeset viewer.