Ignore:
Timestamp:
Feb 20, 2018, 5:32:17 PM (4 years ago)
Author:
alain
Message:

Fix a bad bug in scheduler...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/process.h

    r433 r435  
    3636#include <hal_atomic.h>
    3737#include <vmm.h>
    38 #include <signal.h>
    3938#include <cluster.h>
    4039#include <vfs.h>
     
    6362    DELETE_ALL_THREADS   = 33,
    6463};
    65 
    66 /*********************************************************************************************
    67  * The termination state is a 32 bits word:
    68  * - the 8 LSB bits contain the user defined exit status
    69  * - the 24 other bits contain the flags defined below
    70  ********************************************************************************************/
    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()     */
    7664
    7765/*********************************************************************************************
     
    291279
    292280/*********************************************************************************************
    293  * This function allows a client thread running in the owner cluster of a process identified
    294  * 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:
    296284 * - It uses the multicast, non blocking rpc_process_sigaction_client() function to send
    297285 *   parallel requests to all remote clusters containing a process copy. Then it blocks
     
    305293 * It is used by the sys_kill() & sys_exit() functions to handle the "kill" & "exit" syscalls.
    306294 * 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.
    310299 * @ action_type : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS
    311300 ********************************************************************************************/
    312 void process_sigaction( process_t * process,
     301void process_sigaction( pid_t       pid,
    313302                        uint32_t    action_type );
    314303
     
    403392                            struct thread_s ** child_thread_ptr );
    404393
    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 called
    412  * 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 
    422394
    423395/********************   File Management Operations   ****************************************/
     
    573545void process_txt_reset_ownership( xptr_t process_xp );
    574546
     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 ********************************************************************************************/
     554pid_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 ********************************************************************************************/
     562void process_txt_display( uint32_t txt_id );
     563
     564
    575565#endif  /* _PROCESS_H_ */
Note: See TracChangeset for help on using the changeset viewer.