Changeset 445 for trunk/kernel
- Timestamp:
- May 29, 2018, 9:27:23 AM (7 years ago)
- Location:
- trunk/kernel
- Files:
-
- 12 added
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.c
r443 r445 30 30 #include <chdev.h> 31 31 #include <printk.h> 32 #include <shared_syscalls.h> 32 33 33 34 /////////////////////////////////////////////////////////////////////////////////// … … 416 417 417 418 // suicide 418 hal_core_sleep();419 sys_exit( EXIT_FAILURE ); 419 420 } 420 421 } -
trunk/kernel/kern/process.c
r443 r445 401 401 uint32_t cycle = (uint32_t)hal_get_cycles(); 402 402 if( DEBUG_PROCESS_DESTROY ) 403 printk("\n[DBG] %s : thread %x enter in cluster %x / pid %x / process%x / cycle %d\n",404 __FUNCTION__ , CURRENT_THREAD , pid , process, cycle );403 printk("\n[DBG] %s : thread %x enter for process %x in cluster %x / cycle %d\n", 404 __FUNCTION__ , CURRENT_THREAD , pid , local_cxy , cycle ); 405 405 #endif 406 406 … … 447 447 cycle = (uint32_t)hal_get_cycles(); 448 448 if( DEBUG_PROCESS_DESTROY ) 449 printk("\n[DBG] %s : thread %x exit / destroyed process %x (pid = %x)/ cycle %d\n",450 __FUNCTION__ , CURRENT_THREAD , p rocess, pid, cycle );449 printk("\n[DBG] %s : thread %x exit / destroyed process %x in cluster %x / cycle %d\n", 450 __FUNCTION__ , CURRENT_THREAD , pid, local_cxy, cycle ); 451 451 #endif 452 452 … … 1379 1379 process_txt_detach( XPTR( local_cxy , old_process ) ); 1380 1380 1381 // request old_thread destruction => old_process destruction1381 // block this old_thread 1382 1382 thread_block( XPTR( local_cxy , old_thread ) , THREAD_BLOCKED_GLOBAL ); 1383 hal_atomic_or( &old_thread->flags , THREAD_FLAG_REQ_DELETE ); 1383 1384 // atomically update old_process descriptor term_state to ask 1385 // the parent process (wait() function) to delete this old_thread 1386 hal_atomic_or( &old_process->term_state , PROCESS_TERM_EXIT ); 1384 1387 1385 1388 hal_fence(); -
trunk/kernel/kern/process.h
r443 r445 535 535 /********************************************************************************************* 536 536 * This function detach a process, identified by the <process_xp> argument, 537 * from the list of process attached to a given TXT terminal. 537 * from the list of process attached to a given TXT terminal. It transfer the TXT ownership, 538 * if the detached process is the TXT owner. 538 539 * The target process descriptor must be in the owner cluster, but the calling thread can 539 540 * be running in any cluster. -
trunk/kernel/kern/scheduler.c
r443 r445 248 248 uint32_t cycle = (uint32_t)hal_get_cycles(); 249 249 if( DEBUG_SCHED_HANDLE_SIGNALS < cycle ) 250 printk("\n[DBG] %s : thread %x in proces %x on core[%x,%d] deleted / cycle %d\n",250 printk("\n[DBG] %s : thread %x in process %x on core[%x,%d] deleted / cycle %d\n", 251 251 __FUNCTION__ , thread->trdid , process->pid , local_cxy , thread->core->lid , cycle ); 252 252 #endif -
trunk/kernel/kernel_config.h
r443 r445 97 97 #define DEBUG_PROCESS_GET_LOCAL_COPY 0 98 98 #define DEBUG_PROCESS_INIT_CREATE 0 99 #define DEBUG_PROCESS_MAKE_EXEC 099 #define DEBUG_PROCESS_MAKE_EXEC 1 100 100 #define DEBUG_PROCESS_MAKE_FORK 0 101 101 #define DEBUG_PROCESS_REFERENCE_INIT 0 102 102 #define DEBUG_PROCESS_SIGACTION 0 103 #define DEBUG_PROCESS_TXT _ATTACH 0103 #define DEBUG_PROCESS_TXT 2 104 104 #define DEBUG_PROCESS_ZERO_CREATE 0 105 105 … … 124 124 125 125 #define DEBUG_SYS_DISPLAY 0 126 #define DEBUG_SYS_EXEC 0127 #define DEBUG_SYS_EXIT 0126 #define DEBUG_SYS_EXEC 1 127 #define DEBUG_SYS_EXIT 1 128 128 #define DEBUG_SYS_FG 0 129 129 #define DEBUG_SYS_FORK 0 130 130 #define DEBUG_SYS_GET_CONFIG 0 131 131 #define DEBUG_SYS_ISATTY 0 132 #define DEBUG_SYS_KILL 0132 #define DEBUG_SYS_KILL 2 133 133 #define DEBUG_SYS_MMAP 0 134 134 #define DEBUG_SYS_READ 0 … … 139 139 #define DEBUG_SYS_THREAD_SLEEP 0 140 140 #define DEBUG_SYS_THREAD_WAKEUP 0 141 #define DEBUG_SYS_THREAD_YIELD 2 141 142 #define DEBUG_SYS_TRACE 0 142 143 #define DEBUG_SYS_WAIT 0 … … 153 154 #define DEBUG_THREAD_KERNEL_CREATE 0 154 155 #define DEBUG_THREAD_KILL 0 155 #define DEBUG_THREAD_USER_CREATE 0156 #define DEBUG_THREAD_USER_CREATE 2 156 157 #define DEBUG_THREAD_USER_FORK 0 157 158 #define DEBUG_THREAD_BLOCK 0 -
trunk/kernel/syscalls/sys_display.c
r443 r445 244 244 chdev_dir_display(); 245 245 } 246 //////////////////////////////// 247 else if( type == DISPLAY_DQDT ) 248 { 249 dqdt_display(); 250 } 246 251 //// 247 252 else -
trunk/kernel/syscalls/sys_exit.c
r443 r445 86 86 thread_delete( XPTR( local_cxy , this ) , pid , true ); 87 87 } 88 88 89 89 // remove process from TXT list 90 90 process_txt_detach( owner_xp ); -
trunk/kernel/syscalls/sys_thread_yield.c
r421 r445 22 22 */ 23 23 24 #include <hal_types.h> 25 #include <hal_special.h> 24 26 #include <scheduler.h> 27 #include <thread.h> 25 28 26 29 int sys_thread_yield() 27 30 { 31 32 #if DEBUG_SYS_THREAD_YIELD 33 uint64_t tm_start; 34 uint64_t tm_end; 35 tm_start = hal_get_cycles(); 36 if( DEBUG_SYS_THREAD_YIELD < tm_start ) 37 printk("\n[DBG] %s : thread %x deschedule / process %x / cycle %d\n", 38 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_start ); 39 #endif 40 41 // deschedule 28 42 sched_yield("user request"); 43 44 #if DEBUG_SYS_THREAD_YIELD 45 tm_end = hal_get_cycles(); 46 if( DEBUG_SYS_THREAD_YIELD < tm_start ) 47 printk("\n[DBG] %s : thread %x resume / process %x / cycle %d\n", 48 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_end ); 49 #endif 50 29 51 return 0; 30 52 } -
trunk/kernel/syscalls/syscalls.h
r443 r445 195 195 ****************************************************************************************** 196 196 * @ pathname : pathname (can be relative or absolute). 197 * @ flags : bit vector attributes (see below).197 * @ flags : bit vector attributes (see in shared_fcntl.h file) 198 198 * @ mode : access rights. 199 199 * @ return file descriptor index in fd_array if success / return -1 if failure. … … 572 572 * - DISPLAY_VFS : all files registered in the VFS cache. 573 573 * - DISPLAY_CHDEV : all registered channel devices. 574 * - DISPLAY_DQDT : all DQDT nodes. 574 575 ****************************************************************************************** 575 576 * type : [in] type of display … … 622 623 int sys_fg( pid_t pid ); 623 624 625 /****************************************************************************************** 626 * [49] TBD 627 ****************************************************************************************** 628 * @ cxy : cluster identifier. 629 * @ lid : core local index. 630 * @ return 0 if success / return -1 if failure. 631 *****************************************************************************************/ 624 632 int sys_place( uint32_t cxy, 625 633 uint32_t lid );
Note: See TracChangeset
for help on using the changeset viewer.