Changeset 435 for trunk/kernel/kern/process.h
- Timestamp:
- Feb 20, 2018, 5:32:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.h
r433 r435 36 36 #include <hal_atomic.h> 37 37 #include <vmm.h> 38 #include <signal.h>39 38 #include <cluster.h> 40 39 #include <vfs.h> … … 63 62 DELETE_ALL_THREADS = 33, 64 63 }; 65 66 /*********************************************************************************************67 * The termination state is a 32 bits word:68 * - the 8 LSB bits contain the user defined exit status69 * - the 24 other bits contain the flags defined below70 ********************************************************************************************/71 72 #define PROCESS_FLAG_BLOCK 0x100 /*! process received as SIGSTOP signal */73 #define PROCESS_FLAG_KILL 0x200 /*! process terminated by a sys_kill() */74 #define PROCESS_FLAG_EXIT 0x400 /*! process terminated by a sys_exit() */75 #define PROCESS_FLAG_WAIT 0x800 /*! parent process executed successfully a sys_wait() */76 64 77 65 /********************************************************************************************* … … 291 279 292 280 /********************************************************************************************* 293 * This function allows a client thread running in the owner cluster of a process identified294 * by the <process> argument to block, unblock or delete all threads of the target process,295 * depending on the<action_type> argument. The scenario is the following:281 * This function allows a client thread running in any cluster to block, unblock or delete 282 * all threads of a process identified by the <pid> argument, depending on the 283 * <action_type> argument. The scenario is the following: 296 284 * - It uses the multicast, non blocking rpc_process_sigaction_client() function to send 297 285 * parallel requests to all remote clusters containing a process copy. Then it blocks … … 305 293 * It is used by the sys_kill() & sys_exit() functions to handle the "kill" & "exit" syscalls. 306 294 * It is also used by the process_make_exec() function to handle the "exec" syscall. 307 * WARNING : the DELETE and the BLOCK actions are NOT executed on the client thread. 308 ********************************************************************************************* 309 * @ process : pointer on the process descriptor in owner cluster. 295 * It is also called by the TXT device to execute the ctrl C & ctrl Z commands. 296 * WARNING : the DELETE action is NOT executed on the main thread (thread 0 in owner cluster). 297 ********************************************************************************************* 298 * @ pid : target process identifier. 310 299 * @ action_type : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS 311 300 ********************************************************************************************/ 312 void process_sigaction( p rocess_t * process,301 void process_sigaction( pid_t pid, 313 302 uint32_t action_type ); 314 303 … … 403 392 struct thread_s ** child_thread_ptr ); 404 393 405 /*********************************************************************************************406 * This function is called by both the sys_kill() and sys_exit() system calls.407 * It must be executed by an RPC thread running in the target process owner cluster.408 * It uses twice the process_sigaction() function:409 * - first, to block all target process threads, in all clusters.410 * - second, to delete all target process threads in all clusters.411 * Finally, it synchronizes with the parent process sys_wait() function that MUST be called412 * by the parent process main thread.413 *********************************************************************************************414 * @ process : pointer on process descriptor in owner cluster.415 * @ is_exit : true when called by sys_exit() / false when called by sys_kill().416 * @ exit_status : exit status, when called by sys_exit().417 ********************************************************************************************/418 void process_make_kill( process_t * process,419 bool_t is_exit,420 uint32_t exit_status );421 422 394 423 395 /******************** File Management Operations ****************************************/ … … 573 545 void process_txt_reset_ownership( xptr_t process_xp ); 574 546 547 /********************************************************************************************* 548 * This function returns the terminal owner process (foreground process) 549 * for a given TXT terminal identified by its <channel> index. 550 ********************************************************************************************* 551 * @ channel : TXT terminal channel. 552 * @ return owner process identifier. 553 ********************************************************************************************/ 554 pid_t process_get_txt_owner( uint32_t channel ); 555 556 /********************************************************************************************* 557 * This debug function diplays on the kernel terminal the list of processes attached 558 * to a given terminal identified by the <txt_id> argument. 559 ********************************************************************************************* 560 * @ txt_id : TXT terminal channel. 561 ********************************************************************************************/ 562 void process_txt_display( uint32_t txt_id ); 563 564 575 565 #endif /* _PROCESS_H_ */
Note: See TracChangeset
for help on using the changeset viewer.