Changeset 473 for trunk/kernel/kern/thread.c
- Timestamp:
- Aug 21, 2018, 6:01:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/thread.c
r469 r473 528 528 if( error ) 529 529 { 530 vseg_detach( &child_process->vmm ,vseg );530 vseg_detach( vseg ); 531 531 vseg_free( vseg ); 532 532 thread_release( child_ptr ); … … 549 549 // increment the forks counter 550 550 remote_spinlock_lock( lock_xp ); 551 hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->forks ), 1 );551 hal_remote_atomic_add( forks_xp , 1 ); 552 552 remote_spinlock_unlock( lock_xp ); 553 553 … … 1130 1130 1131 1131 1132 ///////////////////////////////////////////////// 1133 void thread_user_time_update( thread_t * thread ) 1134 { 1135 // TODO 1136 // printk("\n[WARNING] function %s not implemented\n", __FUNCTION__ ); 1137 } 1138 1139 /////////////////////////////////////////////////// 1140 void thread_kernel_time_update( thread_t * thread ) 1141 { 1142 // TODO 1143 // printk("\n[WARNING] function %s not implemented\n", __FUNCTION__ ); 1132 /////////////////////////////////////////// 1133 void thread_time_update( thread_t * thread, 1134 uint32_t is_user ) 1135 { 1136 cycle_t current_cycle; // current cycle counter value 1137 cycle_t last_cycle; // last cycle counter value 1138 1139 // get pointer on thread_info structure 1140 thread_info_t * info = &thread->info; 1141 1142 // get last cycle counter value 1143 last_cycle = info->last_cycle; 1144 1145 // get current cycle counter value 1146 current_cycle = hal_get_cycles(); 1147 1148 // update thread_info structure 1149 info->last_cycle = current_cycle; 1150 1151 // update time in thread_info 1152 if( is_user ) info->usr_cycles += (current_cycle - last_cycle); 1153 else info->sys_cycles += (current_cycle - last_cycle); 1144 1154 } 1145 1155
Note: See TracChangeset
for help on using the changeset viewer.